Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| |||||||||||
Interview Questions and Answers - Order By Rating | |||||||||||
| |||||||||||
Ans. Methods , Variables , Initialization Blocks and nested Classes | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  oops   java   static   nested classes   static nested classes | |||||||||||
Try 2 Question(s) Test | |||||||||||
Ans. Constructors , Classes ( Outer ) , Interfaces , Local variables , Inner Class methods and instance variables. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  oops   java   static   nested classes   static nested classes | |||||||||||
Try 2 Question(s) Test | |||||||||||
| |||||||||||
Ans. Method Nested Static Inner Class | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   classes   inner classes | |||||||||||
Try 1 Question(s) Test | |||||||||||
Must know at all levels. Among Top 10 frequently asked questions in Java. Very frequently asked to fresh graduates or less experienced professionals. | |||||||||||
| |||||||||||
Ans. Its a facility for code reuse and independent extension wherein a derived class inherits the properties of parent class. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  inheritance  object oriented programming (oops)  oops concepts  oops concepts  java concepts  code reuse  code re-use   classes  derived classes Asked in 14 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. A Java bean is a class which abides by following conventions: Core of the object is member elements and not operations ( methods ) Member Elements can be accessed by getters (and setters if those properties are not read-only). serializable. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java bean   javabean   pojo   classes basic   frequent | |||||||||||
| |||||||||||
Ans. There are different verticals in which Java Classes can be classified. 1. Access - Public , Private , default or Protected. 2. Packaging - System, library or User Defined 3. Structure - Outer or Inner 4. Object Derivation - Abstract Class or Concrete Class. 5. Object Creation - Normal, Singleton , Doubleton , Immutable or Enum. 6. Functionality - String , Util , Stream etc. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  classes   different types of classes Asked in 1 Companies | |||||||||||
Try 1 Question(s) Test | |||||||||||
| |||||||||||
Ans. As Class B has been declared abstract , we can either implement any of these methods and just declare rest of them abstract. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  interfaces  abstract classes  code  coding | |||||||||||
Try 2 Question(s) Test | |||||||||||
| |||||||||||
Ans. It could be worthy to move a method to util class if the method needs to be shared, doesn't require polymorphic behavior and need not be overridden in special cases. Don't belong to one group through is-a relationship ( You can share through parent class method ) Don't implement a specific interface ( java 8 default methods ) Doesn't involve complex computing as you will be loosing the benefit of object state with just static method. Doesn't require polymorphic behavior as static methods don't participate in runtime polymorphism. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  utility classes   util classes   static methods   application design   rare | |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||