PACKAGES AND INTERFACE ONE LINER PART 03
1) How many concrete classes can you have inside an interface?
Ans.: None
2) Can you extend an interface?
Ans.: Yes
3) Is it necessary to implement all the methods of an interface while implementing the interface?
Ans.: No
4) If you do not implement all the methods of an interface while implementing , what specifier should you use for the class ?
Ans.: abstract
5) How do you achieve multiple inheritance in Java?
Ans: Using interfaces.
6) How to declare an interface example?
Ans : access class classname implements interface.
7) Can you achieve multiple interface through interface?
a)True
b) false
Ans : a.
8) Can variables be declared in an interface ? If so, what are the modifiers?
Ans : Yes. final and static are the modifiers can be declared in an interface.
9) What are the possible access modifiers when implementing interface methods?
Ans : public.
10) Can anonymous classes be implemented an interface?
Ans : Yes.
11) Interfaces can’t be extended.
a)True
b)False
Ans : b.
2) Name interfaces without a method?
Ans : Serializable, Cloneble & Remote.
13) Is it possible to use few methods of an interface in a class ? If so, how?
Ans : Yes. Declare the class as abstract.
Ans.: None
2) Can you extend an interface?
Ans.: Yes
3) Is it necessary to implement all the methods of an interface while implementing the interface?
Ans.: No
4) If you do not implement all the methods of an interface while implementing , what specifier should you use for the class ?
Ans.: abstract
5) How do you achieve multiple inheritance in Java?
Ans: Using interfaces.
6) How to declare an interface example?
Ans : access class classname implements interface.
7) Can you achieve multiple interface through interface?
a)True
b) false
Ans : a.
8) Can variables be declared in an interface ? If so, what are the modifiers?
Ans : Yes. final and static are the modifiers can be declared in an interface.
9) What are the possible access modifiers when implementing interface methods?
Ans : public.
10) Can anonymous classes be implemented an interface?
Ans : Yes.
11) Interfaces can’t be extended.
a)True
b)False
Ans : b.
2) Name interfaces without a method?
Ans : Serializable, Cloneble & Remote.
13) Is it possible to use few methods of an interface in a class ? If so, how?
Ans : Yes. Declare the class as abstract.
benefit of government job is that along with fixed salary they also get fixed number of holidays and many other allowances which are very beneficial for the employee. Get Free Govt Job Alert in India from NewsGovtJobsAlert.
ReplyDelete