So if an abstract class has an abstract method class inheriting the abstract class should implement the method or else java compiler will through an error. Abstract methods should be implemented in the subclasses which inherit them. Abstract methods do not have implementation. Questions : 7 What are Abstract methods? Answers : 7 Abstract class can contain abstract methods. => Normally abstract classes have base implementation and then child classes derive from the abstract class to make the class concrete. Below are some points for abstract class:=>We can not create object of abstract class it can only be inherited in a below class. Questions : 6 What is an Abstract class ? Answers : 6 Abstract class defines an abstract concept which can not be instantiated and comparing o interface it can have some implementation while interfaces can not. Every object have there own state and identity, which differ from instance to instance. Objects are created, initialized, necessary functionalities are done and later the object is destroyed. Object lifetime All objects have life time. This is achieved when objects send messages to each other. In short these objects should communicate with each other. We will use Customer object, Order object, Product object and Payment object to achieve this functionality. Example if we want to make order processing form. A single object can not do the entire task. Communication Using messages when application wants to achieve certain task it can only be done using combination of objects. Encapsulation The process of hiding all the internal details of an object from the outside world. Example color is abstracted to RGB.By just making the combination of these three colors we can achieve any color in world. Questions : 5 What are different properties provided by Object-oriented systems ? Answers : 5 Following are characteristics of Object Oriented System’s:Abstraction It allows complex real world to be represented in simplified manner. Example we can create a Maruti car object with 100 km speed and urgent brakes. Example we have class CAR which has attributes and methods like Speed, Brakes, Type of Car etc.Class CAR is just a prototype, now we can create real time objects which can be used to provide functionality. Class is a blue print while objects are actual objects existing in real world. Class is a definition, while object is instance of the class created. Questions : 4 What is the relation between Classes and Objects? Answers : 4 They look very much same but are not same. Attributes and behavior of an object are defined by the class definition. An object is an entity that has attributes, behavior, and identity. Questions : 3 What is an Object ? Answers : 3 It is a basic unit of a system. It is a comprehensive data type which represents a blue print of objects. Questions : 2 What is a Class ? Answers : 2 A class describes all the attributes of objects, as well as the methods that implement the behavior of member objects. These objects have responsibilities and provide services to application or other objects. Object maps the software model to real world concept. It is a technique to think real world in terms of objects. The DI container will then automatically inject the correct implementation.Questions : 1 What is Object Oriented Programming ? Answers : 1 It is a problem solving technique to develop software systems. In a constructor of a class, you can use the IMyService interface as a parameter. This code tells the DI container to create a new instance of MyService whenever an instance of IMyService is needed. Here is an example of how to register a service and its implementation with the built-in DI container in. NET Core, the built-in Dependency Injection (DI) system allows for the creation of instances of classes and their dependencies to be handled automatically by the framework. Dependency Injection (DI) is a design pattern that allows for the removal of hard-coded dependencies and makes it possible to change them, whether at run-time or compile-time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |