Write Hello World program without using Semicolons

Views: 131   

This is one if the tricky question in Java, as we know every statement in java ends with semicolon (;) so the System.out.println()
Following code shows you how to print a String without using a single semicolon in code.

public class HellowWorldWithoutSemicolon {

    public static void main(String[] args) {

        if (System.out.printf("Hello World!") == null) {

        }
    }
}

Output:

Hello World!
On By