Get rid of System.out

Or how to replace annoying System.out.println with concise println

Some features of Java are annoying for me, especially after several years of Scala experience. First of all: why should I use System.out.println instead of println!

It appears , that this problem can be solved easily:

public interface Printer {
    static <T> void println(T str) {
    static <T> void print(T str) {

Now one can import these static methods:

import static Printer.*;

Et voila!

println("I can print in Java  Scala way!");

See it on github

Please follow and like us:

About Alexandre Kremlianski

Scala / Scala.js / JavaScript programmer


Leave a Reply to Raju Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.