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