How to use only out.println() in Java

In this tutorial I will explain how you can use out.println() without System. in Java language.

If you want to use only out.println() in Java, you must add import static java.lang.System.out;

Full example:

import static java.lang.System.out;
public class Main {
public static void main(String[] args)
{
int a = 100;
int b = 50;
int c = (a - b) / 5;
out.print(c);

}

}

Output will be:

10









Leave a Comment