+ 1

About print statement

How can we write anyname.out.println instead of system.out.println in java code, what package we have to use ?

22nd Jun 2019, 1:40 PM
Soumya Thoutam
2 ответов
0
Print is not a statement. You don't need to import anything, you can simply make your own function: public static void print(String msg) { System.out.println(msg); } If you want to print other datatypes too, you can make the same function with different arguments: public static void print(int msg) { System.out.println(msg); }
22nd Jun 2019, 2:32 PM
Airree
Airree - avatar
0
That's not my question,my question is public static void main() { abc.out.println( ); } Without writing system.out.println in the code how we can execute the above code. Airree
23rd Jun 2019, 11:42 AM
Soumya Thoutam