Java null reserved wordIn Java, null is a reserved word for literal values. It seems like a keyword, but actually, it is a literal similar to true and false. Points to remember
Examples of Java null reserved wordExample 1Let's see a simple example to display the default value of the reference variable. Output: null Example 2Let's see an example to determine whether we can pass null to object reference variable. Output: null Example 3Let's see an example to display the default value of String. Output: null Example 4Let's see an example to return null from a method. Output: null Example 5Let's see an example to provide null to the String variable. Output: value is null
Next TopicJava Keywords
|