Discussion Forum

  1. Home
  2. »
  3. Languages
  4. »
  5. What is the output of...
What is the output of this program?

    class A 
    {
        public int i;
        public int j;
        A() 
       {
            i = 1;
            j = 2;
 }
    }    
    class B extends A 
    {
        int a;
 B() 
        {
            super();
        } 
    }    
    class super_use 
    {
        public static void main(String args[])
        {
            B obj = new B();
            System.out.println(obj.i + " " + obj.j)     
        }
   }

1 2

2 1

Runtime Error

Compilation Error

Answer: A . 1 2
0Shares
0 0

If you think the posted answer is wrong or Confused About the Answer? Ask for Details Here

Know Explanation? Add it Here
we’ll review your comment and contact you soon….

Leave a Reply

Your email address will not be published. Required fields are marked *

0Shares
0
Scroll to Top