ExamVeda
Login
Home
81
What will be the output of the following Java program?
class A 
{
int i;
int j;
     A() 
     {
         i = 1;
         j = 2;
     }
}
class Output 
{
     public static void main(String args[])
     {
          A obj1 = new A();
          A obj2 = new A();
    System.out.print(obj1.equals(obj2));
     }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
82
What would be the result if a class extends two interfaces and both have a method with same name and signature? Lets assume that the class is not implementing that method.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
83
Which of the following is used for implementing inheritance through class?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
84
In order to restrict a variable of a class from inheriting to subclass, how variable should be declared?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
85
What is not type of inheritance?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
86
What will be the output of the following Java code?
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)     
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board