Home java Conclusion in Java PrintLN without System.out

Conclusion in Java PrintLN without System.out

Author

Date

Category

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);

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions