0% found this document useful (0 votes)
3 views

Java

Uploaded by

Rebecca Paul
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Java

Uploaded by

Rebecca Paul
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

JAVA

Java:- Java is an object-oriented programming language. Everything in Java is associated with classes
and objects, along with its attributes and methods. For example: in real life, a car is an object. The car
has attributes, such as weight and color, and methods, such as drive and brake.

OPPS CONCEPTS(Object Oriented Programming System)

Class:- Class is nothing but it is blueprint and collection of objects is known as class.

Object:- Any entity has that state and behavior is known has Object. An object can be defined as instance

Inheritance:- When one object acquires all the properties and behaviors of a parent object, it
is known as inheritance. It provides code reusability. It is used to achieve runtime
polymorphism.

Polymorphism:- If one task is performed in different ways, it is known as polymorphism. In


Java, we use method overloading and method overriding to achieve polymorphism.
example-can be to speak something; for example, a cat speaks meow, dog barks woof, etc.

Abstraction:- Hiding internal details and showing functionality is known as abstraction. In


Java, we use abstract class and interface to achieve abstraction. Example—car we use only
driving but we don’t know how to work in internal parts.

Encapsulation:- Binding (or wrapping) code and data together into a single unit are known as
encapsulation.

You might also like