Programming  Java  Package and Interface

1. Which of these keywords is used to define packages in Java?

pkg Pkg package Package

Workspace

Comments

2. Which of these is a mechanism for naming and visibility control of a class and its content?

Object Packages Interfaces None of the Mentione

Workspace

Comments

3. Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package?

Public Protected No Modifier All of the mentioned

Workspace

Comments

4. Which of these access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?

Public Protected Private No Modifier

Workspace

Comments

5. Which of the following is correct way of importing an entire package ‘pkg’?

import pkg. Import pkg. import pkg.* Import pkg.*

Workspace

Comments

6. Which of the following is incorrect statement about packages?

Package defines a namespace in which classes are stored. A package can contain other package within it. Java uses file system directories to store packages. A package can be renamed without renaming the directory in which the classes are store

Workspace

Comments

7. Which of the following package stores all the standard java classes?

lang java util java.packages

Workspace

Comments

8. Math class belongs to the package

javmath java.lang java.util none of these

Workspace

Comments

9. What class must be extended by all event classes?

javutil.EventListener java.awt.AWTEvent java.util.EventObject java.awt.event.InputEvent

Workspace

Comments

10. What is the name of the Collection interface used to represent elements in a sequence?

Collection Set List Map

Workspace

Comments

 

*Click on the QNo to display a Question.

Total Ans