Skip to main content

ALL ABOUT JAVA



Object-oriented programming (OOPs) is a methodology that simplifies software development and maintenance by providing some rules.

Basic concepts of OOPs are

1.  OBJECTS: An object is an instance of a class. A class is a template or blueprint from which objects are created. So, an object is the instance(result) of a class.

2. CLASS: A class is a group of objects which have common properties. It is a template or blueprint from which objects are created. It is a logical entity. It can't be physical.

A class in Java can contain:

Fields

Methods

Constructors

Blocks

Nested class and interface

3. INHERITANCE: Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs (Object Oriented programming systems).

The idea behind inheritance in Java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of the parent class. Moreover, you can add new methods and fields in your current class also.

Inheritance represents the IS-A relationship which is also known as a parent-child relationship.

4. POLYMORPHISM: Polymorphism in Java is a concept by which we can perform a single action in different ways. Polymorphism is derived from 2 greek words: poly and morphs. The word "poly" means many and "morphs" means forms. So polymorphism means many forms.

There are two types of polymorphism in Java: compile-time polymorphism and runtime polymorphism. We can perform polymorphism in java by method overloading and method overriding.

5. ABSTRACTION: Abstraction is a process of hiding the implementation details and showing only functionality to the user.

6. ENCAPSULATION: Encapsulation in Java is a process of wrapping code and data together into a single unit, for example, a capsule that is mixed with several medicines. Encapsulation in java We can create a fully encapsulated class in Java by making all the data members of the class private. Now we can use setter and getter methods to set and get the data in it. The Java Bean class is an example of a fully encapsulated class.

Comments

Popular posts from this blog

English: ch- VALUE by kendel hippolyte

  B 1. Which two phrases in the poem tell us that the poet is recalling childhood memories? Answer: The 1st and the last phrases recall childhood memories. 2. How do we know that the customers at Ma Branch's shop were mostly poor? Answer: Most of the customers get their household chores and pay the money later to the shopkeepers. They are maintaining diaries. On that basis, we can say that most of the customers are poor. 3. Where did Ma Branch position herself? Answer: We consider that Ma Branch was a good shopkeeping store. The behavior of the seller was quite comfortable with the customer. Therefore during later years Ma Branch has improved and consequently shifted to Super Market. 4. Why do you think the poet said no one ever took her for granted? Answer: Both the lady sellers were genuine and workaholics. They used to sell their shops product with the accurate amount and weight without spending more time. They got this habit by day-to-day practicing. That's why customers li...

Ch5: Language of chemistry

 Q4. Define the following terms. a)  Element  -   An element is a pure substance that cannot be broken down by any physical or chemical means into simpler substances. b) Compound -  A compound is a substance formed when two or more chemical elements are chemically bonded together. In   mixtures , the substances present are not chemically bonded together. c) Chemical symbols -  A chemical symbol is a notation of one or two letters representing a   chemical   element .   A  chemical symbol   is a shorthand method of representing an element. Instead of writing out the name of an element, we represent an element name with one or two letters. d) Chemical formula -  A   compound   is a substance made up of a definite proportion of two or more elements. A   chemical formula   tells us the number of atoms of each element in a compound. It contains the symbols of the atoms of the elements present in...

CH-6: The Circulatory System

  Q7. Give reason for the following. a) The oxygenated and deoxygenated blood in the heart does not get mixed? Answer:  The heart has four chambers two atria and two ventricles. The right atrium receives oxygen-poor blood from the body and pumps it to the right ventricle. The right ventricle pumps the oxygen-poor blood to the lungs. The left atrium receives oxygen-rich blood from the lungs and pumps it to the left ventricle. The left ventricle pumps oxygen-rich blood to the body. The one-way valves present in the heart prevent the backflow of blood, so, O 2   rich and CO  2   rich blood can not be mixed. b) A person with blood group O is called a universal donor. Answer: People with type O- blood are called universal donors because their donated red blood cells have no A, B, or Rh antigens and can therefore be safely given to people of any blood group. ... Their plasma does not contain A or B antibodies and can be transfused safely to all blood types. c) A perso...