Basic Java Interview Question and Answers
29. | What is the difference between abstract class and interface? |
---|---|
|
|
30. | What is shadowing? |
---|---|
Declaring the same variables of parent class in the subclass is known as shadowing. | |
31. | What is the use of bin and lib in JDK? |
---|---|
Bin contains all tools such as javac, appletviewer, awt tool etc. whereas lib contains API and all packages. | |
32. | What is interface? |
---|---|
Interface is similar to a class which may contain method's signature only but not bodies and it is a formal set of method and constant declarations that must be defined by the class that implements it. Interfaces are useful for:
|
|