You are here : Home / Core Java Tutorials / Interview Programs (beginner to advanced) in java / Level2 programs for (beginner)
Another basic but tricky question asked in interviews these days.
Can we give class name as null in java?
class null{} //error
class Null{} //Fine
|
public class nullTrueFalse_asClassVarName {
public static void main(String[] args) {
int null; //error
}
}
Read :
Super keyword in java - Invoke constructor, Access instance variable, Invoke instance method of immediate super class using super
this keyword in java - in constructor, refer instance variable, call instance method, this (current class object) as a parameter, return this
Having any doubt? or you you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.
Related >
Labels:
Core Java
output java programs