Programming  Java  Package and Interface

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

pkg Pkg package Package
Comments

Share QNo: 1

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
Comments

Share QNo: 2

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
Comments

Share QNo: 3

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
Comments

Share QNo: 4

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

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

Share QNo: 5

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
Comments

Share QNo: 6

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

lang java util java.packages
Comments

Share QNo: 7

8. Math class belongs to the package

javmath java.lang java.util none of these
Comments

Share QNo: 8

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

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

Share QNo: 9

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

Collection Set List Map
Comments

Share QNo: 10

 

*Click on the QNo to display a Question.

Total Ans