Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;//This is like a library in C. it imports the ability to accept user input into the java code.
- public class Main{
- public static void main(String[] arg){
- Scanner A= new Scanner (System.in);//This is following Oracle class. The Blue "Scanner" indicates that whatever is next to it will be the variable that stores whatever the user input comes to be. "A" is that variable. The rest is just to allow for that user inoput to be inputted.
- System.out.println("Write message here: ");
- String message= A.nextLine();//"A.nextLine()" assigns the user input above to a string. So then this allows the string to be printed in the next line of code.
- System.out.println(message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment