public class ExitScannerOnSpecificWord { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter some value : "); String value=null; do{ value = sc.next(); System.out.println("Enter country name : "+value); } while (!value.equals("")); sc.close(); System.out.println("*****INPUT CLOSED "); } }
No comments:
Post a Comment