Commonly asked Data Structures and Algorithms Problems by big tech and different solution approaches with code in Java and C

Powered by Blogger.

Friday, July 14, 2017

System.out.print Short


Problem ; How to make System.out.print / System.out.println shorter ?

SOlution :

1:
Import class statically and call using out.print()
ex :

import static java.lang.System.out;
out.print("abc");

2 :

Make a function print and pass object as argument and give argument to system.out.print

Ex:

Print(Object j)
{
System.out.print(j);
}

Print("fdf ");

0 Comments:

Post a Comment

Stats