class bananas
{
public static void main(String args[])
{
Scanner eggs = new Scanner(System.in); //eggs is just a word I picked.
System.out.println("Type words and system will show you what you typed in another line.");
System.out.println(eggs.nextLine()); //System gets eggs(scanner) and ensures they are words. (1) Eggs gets the input.[in] (2) System prints it out.[out]
System.out.println("Type words and system will show you what you typed in another line.");
System.out.println(eggs.nextLine()); //System gets eggs(scanner) and ensures they are words. (1) Eggs gets the input.[in] (2) System prints it out.[out]
System.out.println("Type numbers and system will show you what you typed in another line.");
System.out.println(eggs.nextInt()); //System gets eggs(scanner) and ensures they are numbers. (1) Eggs gets the input.[in] (2) System prints it out.[out]
}
}
System.out.println(eggs.nextInt()); //System gets eggs(scanner) and ensures they are numbers. (1) Eggs gets the input.[in] (2) System prints it out.[out]
}
}
No comments:
Post a Comment