One interviewer asked me this below question what is the output of the program.
But I try it in my end the line one compile but line two not compile what is the reason behind it.
Anyone can tell me please.
package swain.javainterviewhub.blogspot.in;
import java.util.Scanner;
public class JavaInterviewHub {
public static void main(String[] args) {
String str=null;
System.out.println(str);//Line 1 Compile
System.out.println(null);/Line 2 Not compile
}
}
What is null in real.Its string or charecter or integer.My question is what is null type. Thanks Sitansu