-2
Scanner sc = new Scanner(System.in);
System.out.println("Enter the details given below.");
System.out.println("Name:");name=sc.next();
sc.next();
System.out.println("Phone/mobile number:+91 ");phone_num=sc.nextLong();
System.out.println("Home Address:");address=sc.next();
sc.next();
System.out.println("Pincode:");pincode=sc.nextLong();
System.out.println("E-mail address:");e_mail=sc.next();
sc.next();
這段代碼不會讓我輸入pincode變量。如何在一個字符串之後輸入一個長輸入
閱讀的javadoc FO的'下一個()'和'nexlLine()'仔細的方法。然後看看你的代碼。重複,直到你明白了!這是一個調試問題...你需要自己解決。否則,你將無法在考試或面試中做這件事。 –