CodesJava

Easy learning with example program codes

OOPs concepts in java


OOPs principles are as follows:

  1. Abstraction.
  2. Encapsulation.
  3. Polymorphism.
  4. Inheritance.

1. Abstraction:

Abstraction is a way of hiding complexity. Let us take the example of a car. We know that if accelerator pressed, speed will increase but don’t know the internal process how speed will be increased.

2. Encapsulation:

Encapsulation is a process of wrapping code and data into a single unit. Let us take an example of a HR in a company. We communicate through HR not directly with the departments. HR is acting as a public interface here.

3. Polymorphism:

Polymorphism means more than one forms. In java polymorphism is a way in which something behaves differently based on its call. Water can be of in any form solid, liquid or gas.

4. Inheritance:

Inheritance is the way of re-usability of code. Let us take the example of parent and child. A child inherits the properties of its parent.
 
Next Topic: Abstraction in java.
Previous Topic: Object and Class in Java.

Related Topics:

OOPs Basics.
Object and Class in Java.
OOPs Principles/Concepts.
Abstraction in java.
Encapsulation in java.
Polymorphism in java.

 

Posted in Java   

Core Java Tutorial

Programming language overview.
Overview of Java.
Java features
JVM architecture details.
JVM, JRE and JDK.
Java Coding Guidelines.
Some important definitions.
Variable and data types.
Hello world java program.
Core java examples programs.
Important Java Programs.
How to set permanent path in java?
OOPs Basics.
Object and Class in Java.
OOPs Principles/Concepts.
Abstraction in java.
Encapsulation in java.
Polymorphism in java.
Method overloading in java.
Method overriding in java.
Dynamic method dispatch.
Runtime polymorphism.
Association in java.
Inheritance in java.
Aggregation in java.
Command line arguments in java.
Command line argument program in eclipse.
Read input from command line using Scanner.
Java array programs
Java star pattern programs
Java number pattern programs
final in java.
Abstract class in java.
Interface in java.
Custom marker Interface in java.
Constructor in java.
Package in java.
Access modifier in java.
Static import in java.
Package class in java.
this in java.
Instance initialize block.
Anonymous block.
super in java.
Static in java.
final in java.
Java cloning deep and shallow
Shallow vs Clone copy
String handling in java.
String handling programs.
StringBuffer in java.
StringBuilder in java.
Exception Handling Tutorial.
Multithreading Tutoial.
Java input output stream tutorial.
Collections framework in java tutorial.
Collections framework programs.
Java Random class
Java annotations.
Java design principles.
Java 7 features
Java 8 features
Java networking tutorial
Java Reflection tutorial


Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap