Java Programming: Java Package And Interface

Java Package and Interface Objective Questions with Answers from Basic to advanced. What are packages? What is use of packages?

22 Questions


1. Which of these keywords is used to define interfaces in Java?
[A] interface
[B] Interface
[C] intf
[D] Intf
2. Which of these can be used to fully abstract a class from its implementation?
[A] Objects
[B] Packages
[C] Interfaces
[D] None of the Mentioned.
3. Which of these keywords is used to define interfaces in Java?
[A] interface
[B] Interface
[C] intf
[D] Intf
4. Which of these keywords is used to define interfaces in Java?
[A] interface
[B] Interface
[C] intf
[D] Intf
5. Which of these can be used to fully abstract a class from its implementation?
[A] Objects
[B] Packages
[C] Interfaces
[D] None of the Mentioned.
6. Which of these access specifiers can be used for an interface?
[A] Public
[B] Protected
[C] private
[D] All of the mentioned
7. Which of these keywords is used by a class to use an interface defined previously?
[A] import
[B] Import
[C] implements
[D] Implements
8. Which of the following is correct way of implementing an interface salary by class manager?
[A] class manager extends salary {}
[B] class manager implements salary {}
[C] class manager imports salary {}
[D] None of the mentioned.
9. Which of the following package stores all the standard java classes?
[A] lang
[B] java
[C] util
[D] java.packages
10.
Which of the following is incorrect statement about packages?
[A] Interfaces specifies what class must do but not how it does.
[B] Interfaces are specified public if they are to be accessed by any code in the program.
[C] All variables in interface are implicitly final and static.
[D] All variables are static and methods are public if interface is defined pubic



Comments:

alpesh sakhanpara 20 hours ago Reply

Likemcq