What is the output of following program?
- package com.instanceofjava;
- public class B{
- B b= new B();
- public int show(){
- return (true ? null : 0);
- }
- public static void main(String[] args) {
- B b= new B();
- b.show();
- }
- }
- Exception in thread "main" java.lang.StackOverflowError
- at com.instanceofjava.B.<init>(B.java:3)
- at com.instanceofjava.B.<init>(B.java:5)
- at com.instanceofjava.B.<init>(B.java:5)
No comments:
Post a Comment