View Count: 0
Duration: 46 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 52 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 17 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 34 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 33
1. program on same method call using different operation?

class one 
{
int one(int x){
return x*x;}
}
class two extends  one 
{
int one(int x)
{
return x*x*x*;
}
}
class
{
two ref=new one();
ref.one(5);
} 
Options:
  1. Incompatible types
  2. 25
  3. 125
  4. 25 125
View Answer/Explanation:
a
Explanation:

Question No: 2 of 33
2. Write a program to pass the values as arguments and accepting it.

class A
{
final int res(int a, int b)
{
 System.out.println(a+""+b);
return 0;
}
 class B extends A
{
 int res(int a, int b){
 System.out.println(a+""+b);
return 1;
}
class Test
{
public static void main(String args[])
{
B b=new B();
}
System.out.print(b.res(1,2));
} 
Options:
  1. compile error
  2. 1 2
  3. 1
  4. 2
View Answer/Explanation:
a
Explanation:

Question No: 3 of 33
3.Write a program on inheritance and check  weather the given object is instance of a class or not? 

class A{
}
class B extends A{
}
class C extends A{
}
class X
{
A  a1=new B();
if(a1 instanceof  B)
System.out.println(“I'm Class B”);
else if(a1 instanceof A)
System.out.println(“I'm Class A”);
else if(a1 instanceof C)
System.out.println(“I'm Class C”);
else
System.out.print(“no match”); 
Options:
  1. I'm Class A
  2. I'm Class B
  3. I'm Class C
  4. no match
View Answer/Explanation:
b
Explanation:

Question No: 4 of 33
4.write a program on inheritance where by creating an object and initialize  data in it ?

Class Test{
final int res(int a, int b)
{
return 0;
}
}
Class Test1 extends Test
{
final int res(int a, int b)
{
return 1;
}
}
Class x{
Test1 tes=new Test1();
System.out.println(tes.res(0,1));
} 
Options:
  1. 0
  2. 1
  3. compile error
  4. exception
View Answer/Explanation:
c
Explanation:

Question No: 5 of 33
5.write a program on inheritance and access the sub class from the super class.

class A
{
A(int x){
}
class B extends A{
}
class Test{
public static void main(String args[]){
A a= new B();
System.out.print(“completed”);
}
} 
Options:
  1. completed
  2. compile error
  3. exception
  4. displays empty
View Answer/Explanation:
a
Explanation:

Question No: 6 of 33
6.write a program to accept the string by using constructor with similar parameters.  

class x
{
 int i=0;
 public x(String s)
{
i=1;
}
 class y extends x
{
 public y(String s)
{
 i=2;
}
public static void main(String args[])
{
y z=new y(“hello”);
System.out.println(y.i);
}  
} 
Options:
  1. 0
  2. 1
  3. 2
  4. compiler error
View Answer/Explanation:
d
Explanation:

Question No: 7 of 33
7. Which of these keyword must be used to inherit a class? 
Options:
  1. super
  2. this
  3. extent
  4. extends
View Answer/Explanation:
d
Explanation:

Question No: 8 of 33
8. Which of these keywords is used to refer to member of base class from a sub class? 
Options:
  1. upper
  2. super
  3. this
  4. None of the mentioned
View Answer/Explanation:
b
Explanation:

Question No: 9 of 33
8. Which of these keywords is used to refer to member of base class from a sub class? 
Options:
  1. upper
  2. super
  3. this
  4. None of the mentioned
View Answer/Explanation:
b
Explanation:
Explanation: whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.

Question No: 10 of 33
9. A class member declared protected becomes member of subclass of which type? 
Options:
  1. public member
  2. private member
  3. protected member
  4. static member
View Answer/Explanation:
b
Explanation:
A class member declared protected becomes private member of subclass

  1