Programming  Java  Package and Interface

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

pkg Pkg package Package

Share this QA

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

Share this QA

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

Share this QA

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

Share this QA

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

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

Share this QA

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

Share this QA

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

lang java util java.packages

Share this QA

8. Math class belongs to the package

javmath java.lang java.util none of these

Share this QA

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

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

Share this QA

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

Collection Set List Map

Share this QA

 

*Click on the QNo to display a Question.

Total Ans