INHERITANCE


1)

class c1{
   void go(){}
}
class c2 extends c1
{
 String go()
{
  return null;
}
}


1)compile time error
2)runtime exceptione
3)the code compiles and runs fine
4)None of the above

Ans: 1

2)

class base
{
base(int c)
{
 System.out.println("base");
}
}
class Super extends base
{
 Super()
 {
    System.out.println("super");
  }
public static void main(String [] a)
{
      base b1=new  Super();
}
}


1)compile time error
2)runtime exceptione
3)the code compiles and runs fine
4)None of the above

Ans: 1