Java Abstraction

The class that pronounces using the "special" catch phrase is called the abstract class. It consists of abstract methods (extracorporeal methods) as well as solid methods (non abstract methods or concrete methods with the body). A general class (non-abstract class) should not have dynamic patterns.

Reflection is the idea of ​​programming where the element is, which "shows" basic features and "hides" repetitive data. Hiding meaningless subtle skills from customers is the motivation behind the reaction. A reflection of the process of selecting information from a large pool to show the customer the important subtleties of the object. This helps to reduce the mastery and effort of programming. This is one of the important ideas of OOPs.

Why do we need Abstract class in Java?

  • I can say that we have a class animal that has many strategic sounds () and subdivisions (see traditions) such as dog, lion, horse, cat.

  • Since the sound of an organism varies from one organism to another, there is no valid reason to make this method true in the parent class.

  • As the Lion Class says "Thunder" and the Dog Class says "Whoop", each youth class should abolish this practice to give their own application subtle skills.

Therefore, when we realized that all biological youth classes should abolish this practice, there was no valid reason to make this strategy a reality in the parent class at that time.

In this way, the theoretical development of this technique would be an acceptable conclusion, we would authorize all subclasses to make this technique a reality (otherwise you might get something wrong), as well as we would not have to give any implementation to this technique parent class.

Rules for Abstraction

Rule 1:

As we have seen in the sample above, there are situations where the implementation of all strategies in the parent class is complicated or inadvertently useless. In these cases, the parent class can be dynamically pronounced, which alone becomes a complete but extraordinary class. The class, taken from the abstract class, must do virtually every technique that is dynamically pronounced in the parent class.

Rule 2:

Abstract class is not enabled, which means you cannot create its object. To use this class, you need to expand this class and create another class that uses dynamic techniques, during which you will use non-strategies specific to the parent class (even if they are implemented as parental ideology in the child's class) using the elements of that young class as real methods.

Rule 3:

If a young person does not implement all the abstract methods for a particular parent class, the child class at that time should also be conceptually declared.

In particular, reflection is about hiding subtle skills implemented from the customer and providing what the customer needs. One should try to understand it more with the real model. Most of us have a backward attitude when it comes to painting a picture about ourselves. When we went to submit a request for a vehicle, we were not really interested in understanding the best subtleties of using a motor, glove box and every section inside.

We leave that particular subtle skill and application to architects and mechanics to understand - we are primarily interested in the vehicle, not the assembled system. They are interested in giving us what we need and covering up the best application micro skills. Similarly, there are a large number of real models that affect everything from reflection - regardless of the cell phone you use or the TV you are interested in.

Java Training in Vizag

Related Blogs

What is Java?

Advantages of Java

Java Interview Question and Answers