+ 2
Java Program
Why do we write System.out.println();? what is the meaning of the statement or what is the role of this statement?Can we write any other statement instead of System.out.println?
6 Respostas
+ 1
we write a System.out.println() to display the content which we write.
It have meaning like System.out.println():
System is a predefine class and out is present in system class as a method and print is present in out class as a method.It is a hierarchical view.
It is define in java JDK already.
next Yes, we write a another word in the place of System.out.print on.
+ 6
You're using the `System` namespace and the `out` (output) class that's found in it. Println() and Print() are both methods of the out class. Println() is going to print the output and automatically add a newline (\n) to the end of it. Print() is going to print the output but not return to a newline.
At the top of your code put:
import static java.lang.System.out;
^That will allow you to drop the System. from it, so then you can just type out.println("What I want to print here."); instead of having to type out the whole thing.
+ 3
It's calling the standart output to print an empty line on the console.
+ 3
It is important if you need your output to be displayed in the Output Window.
there are two ways to make your output visible when you run the program
1 ) System.out.println() :: It prints your output plus, if there is a second thing to be printed it will be printed automatically in the next line.
2 ) System.out.print() :: It prints your output but in this, the next thing you are printing will not be printed in the next line. it will be printed next to the first output.
Try it in your Code Playground man. ! It will make you learn better.
Practice Makes You Perfect !!! As SL always says. Try it man. !
+ 3
thank you Mr. Tarun. I m completely satisfied to your answer
0
booaa