Try to print string with null in output in java

It’s a very simple program asked in interviews.

What will be output when Try to print string with null in output in java ?

public class PrintStringWithNull {
    public static void main(String[] args) {

This program might look confusing at first look and looks like will end end up in NullPointerException, but it won’t.


Having any doubt? or you you liked the tutorial! Please comment in below section.
Please express your love by liking (JMSE) on facebook, following on google+ or Twitter.

Related >

Super keyword in java - Invoke constructor, Access instance variable, Invoke instance method of immediate super class using super

Interface in java - Multiple inheritance, Marker interfaces, When to use interface practically, 12 features

Abstract class and abstract methods in java - When to use abstract class or interface practically, 10 features

Must read for you :