+ 3
Object oriented programming
Can someone please help me understand OOP in java please I cannot understand it Its really hard.
3 Antworten
+ 3
Hi Miller Monteiro
Hope this is helpful for your concerns about Oop in java.
https://javagoal.com/oops-concepts-in-java/
Also check this out:
https://www.sololearn.com/Discuss/252198/?ref=app
+ 1
Java is an object oriented programming
Features
Classes and objects
Encapsulation
Abstraction
Inheritance
Polymorphism
Class :
collection of methods and variables
collection of objects
class is a modification to structures in c/cpp
We cannot see class
Object :
Realtime entity
Realtime existance
We can see object
A class can have any no of objects
Object refers to only a class
Encapsulation : binding of data and methods is known as encapsulation
We can achieve encapsulation id there is a class
Abstraction : hidhing internal implementation of class and exhibit only functionality
Inheritance : creating a new class from existing class
Existing class is superclass
New class is subclass
A superclass can have more than once child
A child can have only one parent
Types of inheritance
Single : a class is inheriting only 1 class
Multiple : a class is inheriting from more than a class
Multilevel : a class named “x” is subclass to previous class and superclasd to upcoming class
+ 1
Continution
Hierarchical : a class is inherited by more than ond class
Hybrid : ckmbination of 2 of more inhetirances
Polymorphism
Seeing the same thing in different way
Manyforms
Types
Overloading : method name is same but there is a difference in
No of parameters
Types of parameter
Order of parameter
Overriding : subclass is not feeling well with the definition given by superclass
Subclass will give its ownnimplementation