Programming  Java  Package and Interface

Answer each question, once completed click submit.

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

pkg Pkg package Package

Workspace

Discuss

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

Discuss
Ad
Buy Beauty, Health & Personal Care Products | 50% Off or More!!‎‎

399.00    ₹ 179.00
Vast Selection. Best Prices Ever.
Free Delivery Above ₹ 499.

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

Discuss

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

Discuss

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

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

Workspace

Discuss

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

Discuss

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

lang java util java.packages

Workspace

Discuss
Ad

TODAY'S LIGHTNING DEALS - GET NOW for 70% OFF or More

Buy Mobile Accessories at Best Price

Global Brands Coverage.100% On-time Shipment Protection.
Most Popular with Good Customer Ratings..! Shop Now!!

8. Math class belongs to the package

javmath java.lang java.util none of these

Workspace

Discuss

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

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

Workspace

Discuss

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

Collection Set List Map

Workspace

Discuss

11. 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

Workspace

Discuss

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

Vector HashSet LinkedList HashTable

Workspace

Discuss

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

Set SortedSet SortedMap List

Workspace

Discuss

14. 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()

Workspace

Discuss

15. For which purpose packages are used in Java?

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

Workspace

Discuss

16. The first statement in java source file

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

Workspace

Discuss

17. A package is a collection of

classes interfaces editing tools classes and interfaces

Workspace

Discuss

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

interface Interface intf Intf

Workspace

Discuss

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

Objects Packages Interfaces None of the Mentione

Workspace

Discuss

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

Public Protected private All of the mentioned

Workspace

Discuss

21. Which of these keywords is used by a class to use an interface defined previously?

import Import implements Implements

Workspace

Discuss

22. Which of the following is correct way of implementing an interface salary by class manager?

class manager extends salary {} class manager implements salary {} class manager imports salary {} None of the mentione

Workspace

Discuss

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

Interfaces specifies what class must do but not how it does. Interfaces are specified public if they are to be accessed by any code in the program. All variables in interface are implicitly final and stati All variables are static and methods are public if interface is defined pubic.

Workspace

Discuss

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

lang java util java.packages

Workspace

Discuss

25. interface is used to achieve

single inheritance mutiple inheritance Hierarchical inheritance hybrid inheritance

Workspace

Discuss
Ad

Hair Styling Tools

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25