Java Programming - Java Package And Interface Questions and Answers

Java Package and Interface Objective Questions with Answers from Basic to advanced. What are packages? What is use of packages?
1. Which of these keywords is used to define interfaces in Java?
[A] interface
[B] Interface
[C] intf
[D] Intf
Loading...
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.
Loading...
3. Which of these keywords is used to define interfaces in Java?
[A] interface
[B] Interface
[C] intf
[D] Intf
Loading...
4. Which of these keywords is used to define interfaces in Java?
[A] interface
[B] Interface
[C] intf
[D] Intf
Loading...
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.
Loading...
6. Which of these access specifiers can be used for an interface?
[A] Public
[B] Protected
[C] private
[D] All of the mentioned
Loading...
7. Which of these keywords is used by a class to use an interface defined previously?
[A] import
[B] Import
[C] implements
[D] Implements
Loading...
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.
Loading...
9. Which of the following package stores all the standard java classes?
[A] lang
[B] java
[C] util
[D] java.packages
Loading...
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
Loading...
Are these questions helpful for you?

Comments: (Your feedback is valuable to us)

Ruku 3 years ago Reply

Good.But needs more questions in package than interface