Discussion :: Objects and Collections - Finding the output (Q.No.2)
|Deep said: (Dec 5, 2013)|
|As per my knowledge null is not a keyword, so we can assign in any way.|
|Jitendra said: (Oct 3, 2014)|
|String str =" NULL";
NULL is not a keyword.
|Skumar said: (Apr 21, 2017)|
|The null is a keyword in java and it is case sensitive. So, we can use null instead of NULL or Null.
The Following program will run successfully.
public class Test
public static void main (String args)
String str = null;
Output : null.
|Bagsari said: (Nov 18, 2017)|
|Compile time error everything in string enclosed within double quotes am I right.|
|Priyank said: (Nov 5, 2020)|
|I think it will throw NullPointerException, which means RuntimeException.|
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.