+ 3

In System.out.println(); what is out???

Can anybody tell me.... pls anyone accept my challenge

29th Mar 2018, 7:08 PM
Arun Tomar
Arun Tomar - avatar
8 Answers
+ 1
"Out" is a reference variable of prinstream Class. which is declared as "static " in System class.. which hold the reference id of object of prinstream class
29th Mar 2018, 7:20 PM
Arun Tomar
Arun Tomar - avatar
+ 2
This is the answer of my questions.. thanks..
29th Mar 2018, 7:23 PM
Arun Tomar
Arun Tomar - avatar
+ 2
I wrote up some code to show you how you could make your Java "System.out" life a lot easier. Code is below. You can shorten it so that you're not always stuck writing out the entire namespace for simple, most frequently used syntax. https://code.sololearn.com/cJJXxrsTgvXR/#java // We'll import this so we don't have to always type System.out import static java.lang.System.out; public class Program { // Custom function for System.out.println() public static void println(String string){ System.out.println(string); } // Custom function for System.out.print() public static void print(String string){ System.out.print(string); } public static void main(String[] args) { // Using the import we created at top, shortend to out.println() out.println("test"); // Using the custom function we created, shortened to println() println("test2"); // Using the custom function we created, shortened to print() print("test3"); print("...test4"); } } ::::: OUTPUT ::::: test test2 test3...test4 ^You can store the custom functions inside of another file and import it into whatever projects you want to use it in. As well, you can rename them to anything you want, and even further, you can create custom features for each or expand the native functions further.
29th Mar 2018, 7:31 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 2
Mr Jakob. I not steal your answer. what you describe me.. while using static import.. you only prove me right... BIG THANKS
29th Mar 2018, 7:40 PM
Arun Tomar
Arun Tomar - avatar
+ 1
my question is... what is "out" in System. out.println();
29th Mar 2018, 7:11 PM
Arun Tomar
Arun Tomar - avatar
+ 1
'out' is the class for the System OUTPUT. println() is a method of that class. System.out is the namespace that contains println(), among other system output functions.
29th Mar 2018, 7:18 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
You unknowingly did, which is why I only pointed it out. However, I am not mad at you and I understand how it happened, which is why I still posted the code examples for you and explained all of it. No worries! :) Either way, you're welcome and I hope the information is useful toward your learning. Good luck with your studies! Take care bro.
29th Mar 2018, 7:49 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
Thanks for your work.. I appropriate you.
29th Mar 2018, 7:51 PM
Arun Tomar
Arun Tomar - avatar