| Snaprecruit.com

| Snaprecruit.com

Interview question based on skill :

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. When multiple inheritance is used, which class object should be used in order to access all the available members of parent and derived class ?

Correct Answer is : 1

2. If all the members of all the base classes are private then,

Correct Answer is : FALSE

3. Is it compulsory to have constructor for all the classes involved in multiple inheritance?

Correct Answer is : dynamically generated

4. If a class contains 2 nested class and is being inherited by another class, will there be any multiple inheritance?

Correct Answer is : $

5. Which members can’t be accessed in derived class in multiple inheritance ?

Correct Answer is : DECIMAL

6. Can the derived class be made abstract if multiple inheritance is used ?

Correct Answer is : C

7. Which among the following best describes a nested class?

Correct Answer is : C

8. Which feature of OOP reduces the use of nested classes?

Correct Answer is : Perl

9. How many categories are nested classes divided into?

Correct Answer is : Perl

10. Non-static nested classes have access to _____________ from enclosing class.

Correct Answer is : TRUE

11. Static nested classes doesn’t have access to _________________ from enclosing class.

Correct Answer is : TRUE

12. The nested class can be declared ___________________

Correct Answer is : C

13. Use of nested class ____________ encapsulation.

Correct Answer is : C

14. Which among the following is correct advantage/disadvantage of nested classes?

Correct Answer is : common gateway interface

15. How to access static nested classes?

Correct Answer is : common gateway interface

16. A nested class can have its own static members.

Correct Answer is : TRUE

17. How to create object of the inner class?

Correct Answer is : TRUE

18. What will be the output of the following code? public class Test { public int a=0; class innerClass { public int a=1; void innermethod(int x) { System.out.println(“value of x = ” + x); System.out.println(“value of this.x = ” + this.x); System.out.println(“value of Test.this.x = ” + Test.T=this.x); } } } public static void main( String args[] ) { Test t=new Test(); Test.innerClass im=t.new innerClass(); im.innermethod(55); }

Correct Answer is : Perl

19. Instance of inner class can exist only _______________ enclosing class.

Correct Answer is : Perl

20. If a declaration of a member in inner class has the same name as that in the outer class, then ________________ enclosing scope.

Correct Answer is : Perl, PHP, C