Can we give class name as null in java?



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

Can we give instance variable name as null in java? 

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 >






eEdit
Must read for you :