What is the output of following program?
- package com.instanceofjava;
- public class A{
- int GetValue()
- {
- return (true ? null : 0);
- }
- public static void main(String[] args) {
- A obj= new A();
- obj.GetValue();
- }
- }
- Exception in thread "main" java.lang.NullPointerException
No comments:
Post a Comment