0
static Product createProduct() {
Scanner sc = new Scanner(System.in);
System.out.println("\nEnter new product ");
System.out.print(" Name: ");
String n =sc.nextLine();
while(n==sc.nextLine()){
if(n !=sc.nextLine()){
System.out.println("ERROR! Please Try again!");
}
sc.nextLine();
}
欢迎堆栈溢出!我建议你阅读http://tinyurl.com/sohints,了解如何编写好问题以获得良好答案。 –