Core java - Interview Questions and Answers for 'Equator business solutions' - 3 question(s) found - Order By Newest Very Frequently asked. Have been asked in HCL Technologies very frequently ( based on 3 feedback ). Among first few questions in many interviews. Q1. Differences between abstract class and interface ? Core Java
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 Related Questions What are the different uses of Interfaces in Java ? Why can't we have diamond problem with interfaces ? What is the difference between List, Set and Map ?
or
What are the different Java Collections Interfaces ? What are Marker Interfaces ? Name few Java marker interfaces ? Why do we need Thread class even in case we execute thread using runnable interface ? Which of the following doesn't extend Collection interface ? If an Abstract class has only abstract methods, What's the difference between such a class and an interface ? What is an API ( Application Programming Interface ) ? Can we declare interface methods as private ? Q2. What are the design considerations while making a choice between using interface and abstract class ? Core Java
Ans. Keep it as a Abstract Class if its a "Is a" Relationsship and should do subset/all of the functionality. Keep it as Interface if its a "Should Do" relationship. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   oops   abstract classes   interfaces   advanced Asked in 3 Companies Related Questions Differences between abstract class and interface ? What are the different uses of Interfaces in Java ? Why can't we have diamond problem with interfaces ? What is the difference between List, Set and Map ?
or
What are the different Java Collections Interfaces ? What are Marker Interfaces ? Name few Java marker interfaces ? Why do we need Thread class even in case we execute thread using runnable interface ? Which of the following doesn't extend Collection interface ? If an Abstract class has only abstract methods, What's the difference between such a class and an interface ? What is an API ( Application Programming Interface ) ? Can we declare interface methods as private ? Q3. Where to use interface and abstract class ? Core Java
This question was recently asked at 'Exterro,Equator Business Solutions'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 2 Companies Related Questions Difference between == and .equals() ? Why is String immutable in Java ? Explain the scenerios to choose between String , StringBuilder and StringBuffer ?
or
What is the difference between String , StringBuilder and StringBuffer ? What are the difference between composition and inheritance in Java? Does garbage collection guarantee that a program will not run out of memory? What is a Lambda Expression ? What's its use ? Why Char array is preferred over String for storing password? What is the difference between final, finally and finalize() ? Explain OOPs
or
Explain OOPs Principles
or
Explain OOPs Concepts
or
Explain OOPs features
or
Tell me something about OOPs What is the difference between Encapsulation and Abstraction?