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. Abstraction is provided in Java by following ways - Coding to the ( Interfaces / Abstract Classes ) or contracts By Encapsulating details within classes and exposing the minimal Door ( few public methods ) | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   oops concepts   abstraction   interfaces   abstract class   encapsulation  object oriented programming (oops)  oops concepts Asked in 3 Companies basic   frequent | |||||||||||
Very Frequently asked. Have been asked in HCL Technologies very frequently ( based on 3 feedback ). Among first few questions in many interviews. | |||||||||||
| |||||||||||
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ). A class can extend single abstract class whereas it can implement multiple interfaces. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   classes   abstract class   interfaces   abstract class vs interface   abstract classes vs interfaces Asked in 82 Companies basic   frequent | |||||||||||
Almost sure to be asked in every company using any Dependency Injection framework ( Spring, Guice etc ) | |||||||||||
| |||||||||||
Ans. It is a Design Pattern that facilitates loose coupling by sending the dependency information ( object references of dependent object ) while building the state of the object. Objects are designed in a manner where they receive instances of the objects from other pieces of code, instead of constructing them internally and hence provide better flexibility. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  design patterns   ioc ( Inversion of Control )  dependency injection Asked in 83 Companies intermediate   frequent | |||||||||||
Frequently asked in face to face interviews. | |||||||||||
| |||||||||||
Ans. int count = 15; int[] fibonacci = new int[count]; fibonacci[0] = 0; fibonacci[1] = 1; for(int x=2; x < count; x++){ fibonacci[x] = fibonacci[x-1] + fibonacci[x-2]; } for(int x=0; x< count; x++){ System.out.print(fibonacci[x] + " "); } | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  ebay   fibonacci series Asked in 66 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. ADT is a container which holds different types of objects with specifications. For example - Stack, Array, Liked list, Tree | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  data types  abstract data types | |||||||||||
| |||||||||||
Ans. Abstract means that the class is only meant to be subclassed whereas final means that it cannot be subclassed so both concepts - abstract and final are actually mutually exclusive and hence not permitted together. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract   final   java keywords Asked in 1 Companies | |||||||||||
| |||||||||||
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 should either implement the abstract methods or re-declare them abstract. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  abstract class Asked in 2 Companies Basic   Frequent | |||||||||||
| |||||||||||
| |||||||||||