principles of object oriented programming
Abstraction (Partial Abstraction & Interfaces)
Encapsulation (Private Field & Getter & Setter)
Inheritance (Super and Sub Class)
Polymorphism (Static - Overloading & Dynanmic - Overriding)
0
0
Below mentioned respectively Pillers of OOP concept
and Principles of OOP Design (SOLID)
Pillers of OOP concept
1. Abstraction
2. Encapsulation
3. Inheritance
4. Polymorphism
Principles of OOP Design
1. Single Responsibility Principle (SRP)
2. Open-Closed Principle (OCP)
3. Liskov Substitution Principle (LSP)
4. Interface Segregation Principle (ISP)
5. Dependency Inversion Principle (DIP)
Thank you!
0
0
4.17
6
public class Main {
public static void main(String[] args) {
/*
Creating objects
*/
Cat thor = new Cat();
Cat rambo = new Cat();
/*
Defining Thor cat
*/
thor.name = "Thor";
thor.age = 3;
thor.breed = "Russian Blue";
thor.color = "Brown";
thor.sleep();
/*
Defining Rambo cat
*/
rambo.name = "Rambo";
rambo.age = 4;
rambo.breed = "Maine Coon";
rambo.color = "Brown";
rambo.play();
}
}
Thank you!
6
0
Are there any code examples left?
New code examples in category Other