0
import java.util.Scanner; class MyClass { public static void main(String[ ] args) { Scanner myVar = new Scanner(System.in); System.out.println(myVar.nextLine()); } }
plzz explained it everything...
6 Answers
+ 3
As far as i understand your question,you wanted to know the meaning of each of the code above.
1.import java.until.scanner-it import the scanners method in simple words, it enables you to use scanner method in your program.
2.class- create a class in which all the statements present .
3 Public static void main()- it create a main method it is very important to create a main method in the program.( actually in this statement public means this method is accessible for all functions or something like that, also there's some other meaning of static And void best I am not going to elaborate because you are a beginner and that will only confuse you now,so digest the simple meaning for now).
3.scanner- it is used for getting user input
4.system.out.println- this shows output(simple for now)
+ 2
scanner(system.in) is used to read user input from keyboard
0
Please explain your question clearly so that we can help you better.
0
what is the work of 'import java.until.scanner' in this program?
0
The import statement loads the classes (methods etc.) for the specific Java library from the Java API. In your example its java.util.Scanner for user (console) input.
0
As far as i understand your question,you wanted to know the meaning of each of the code above.
1.import java.until.scanner-it import the scanners method in simple words, it enables you to use scanner method in your program.
2.class- create a class in which all the statements present .
3 Public static void main()- it create a main method it is very important to create a main method in the program.( actually in this statement public means this method is accessible for all functions or something like that, also there's some other meaning of static And void best I am not going to elaborate because you are a beginner and that will only confuse you now,so digest the simple meaning for now).
3.scanner- it is used for getting user input
4.system.out.println- this shows output(simple for now)