Question 10012 – Calculus
November 10, 2023Question 5467 – NIELIT Junior Teachnical Assistant_2016_march
November 10, 2023OOPS
Question 140 |
Is null an object?
yes | |
No | |
Sometimes yes | |
None of these |
Question 140 Explanation:
If null were an Object, it would support the methods of java.lang.Object such as equals().
However, this is not the case – any method invocation on a null results in a NullPointerException.
There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type
However, this is not the case – any method invocation on a null results in a NullPointerException.
There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type
Correct Answer: A
Question 140 Explanation:
If null were an Object, it would support the methods of java.lang.Object such as equals().
However, this is not the case – any method invocation on a null results in a NullPointerException.
There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type
However, this is not the case – any method invocation on a null results in a NullPointerException.
There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type
Subscribe
Login
0 Comments