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.
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 :
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 :
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application
1. Controller receives the requests and handles overall control of the request
2. Model holds majority of the Business logic, and
3. View comprise of the view objects and GUI component
Help us improve. Please let us know the company, where you were asked this question :
Ans. You can implement encapsulation in Java by keeping the fields (class variables) private and providing public getter and setter methods to each of them. Java Beans are examples of fully encapsulated classes. Encapsulation in Java: Restricts direct access to data members (fields) of a class.
Help us improve. Please let us know the company, where you were asked this question :
Ans. We can have 2 entities i.e EMPLOYEE and ADDRESS and can have a relationship Table , EMPLOYEE_ADDRESS having one to may relationship between the two.
Help us improve. Please let us know the company, where you were asked this question :