how and what you need to import something in the code just write println (“…”); without System.out. ?
These two ways have their pros and cons. What are they?
- System.out.printLN (“….”);
- PrintLN (“….”);
Answer 1, Authority 100%
import static java.lang.system. *;
and you can bring to the Console Command
out.println ("");
Pros and cons … less scribbling. Java.lang package is automatically imported, and without importing it would have to write to you to write java.lang.system.out.println (");
If you are lazy to print Sout + Tab
– create your own method with short name P
and call it.
Public Static Void P (String TXT) {
System.out.PrintLN (TXT);
}
Public Static Void Main (String [] Args) {
P ("Text");
}
If you need to print
Public Static Void P (Object OB) {
System.Out.printLN (OB);