import java.util.Scanner;
class lab5c
{
public static void main (String args[])
{
String name;
Scanner input=new Scanner(System.in);
System.out.print("Enter a name: ");
name=input.nextLine();
if (name.startsWith( "Liyana" ) || name.startsWith( "Batrisyia" ) || name.startsWith( "Arfa" ) )
System.out.println( "Ms. "+name );
else
System.out.println( "Mr. "+name );
}
}
如何继续循环程序,直到用户在没有先输入名称的情况下点击“输入”。