Programming  Java  Package and Interface

1. Which of the following statement is false?

Variables declared inside of interface declaration may be changed by implementing class Interfaces are designed to support dynamic method resolution at run time When an interface method is implemented it must be declared as public Variables declaration are implicitly final

2. Which of the following classes directly implement Set interface?

Vector HashSet LinkedList HashTable

3. TreeMap class is used to implement which one of the following collection interfaces?

Set SortedSet SortedMap List

4. Which of the following is the correct syntax for suggesting that the JVM performs garbage collection?

System.free() System.setGarbageCollection() Syste.out.gc() System.gc()

5. For which purpose packages are used in Java?

Categorizes data Organizing java classes into namespaces For faster compilation None of these

6. The first statement in java source file

import statement package statement main statement try{} and catch{}

7. A package is a collection of

classes interfaces editing tools classes and interfaces

8. Which of these keywords is used to define interfaces in Java?

interface Interface intf Intf

9. Which of these can be used to fully abstract a class from its implementation?

Objects Packages Interfaces None of the Mentione

10. Which of these access specifiers can be used for an interface?

Public Protected private All of the mentioned

 

*Click on the QNo to display a Question.

Total Ans

 

 

';
Aptitude Coaching - Free Live Session !!