Next:
Programming Paradigms
Up:
A CONCISE MANUAL ON
Previous:
Labeled continue Statement
Contents
Object-Oriented Programming
Subsections
Programming Paradigms
Object-Oriented Programming
Features
Objects and classes
Class-based vs prototype-based
Dynamic dispatch/message passing
Encapsulation
Composition, inheritance, and delegation
Polymorphism
Open recursion
OOP in dynamic languages
Classes & Objects in Java
Class
Object
Declaring Objects
Initializing an object
Ways to create object of a class
Creating multiple objects by one type only
Anonymous objects
Inner Classes (Nested)
Advantage of Java inner classes
Types of Nested classes
Methods in Java
Method Declaration
Types of Method
Predefined Method
User-defined Method
How to Call or Invoke a User-defined Method?
Static Method
Instance Method
Abstract Method
Constructors in Java
Default Constructor
Parameterized Constructor
Constructor Overloading
static
,
this
,
Super
&
final
keywords
static
Java static variable
Java static method
Java static block
this
keyword in Java
To refer current class instance variable
To invoke current class method
To invoke current class constructor
To pass as an argument in the method
To pass as argument in the constructor call
To return current class instance
Super
Keyword in Java
super
is used to refer immediate parent class instance variable.
super
can be used to invoke parent class method
super
is used to invoke parent class constructor
final
keyword
Java final variable
Java final method
Java final class
Blank or uninitialized final variable
static blank final variable
final parameter
Modules
Packages
Subpackage in java
Example of Subpackage
Encapsulation
Abstraction
Abstract class in Java
Abstract Method in Java
Real scenario
Abstract class having constructor, data member and methods
Interface
Java Interface Example
Java Interface Real time example
Multiple inheritance in Java by interface
Interface inheritance
Default Method in Interface
Static Method in Interface
Nested Interface in Java
Inheritance
Types of inheritance in java
Single Inheritance Example
Multilevel Inheritance Example
Hierarchical Inheritance Example
Polymorphism
Runtime Polymorphism in Java
Example of Java Runtime Polymorphism
Java Runtime Polymorphism Example: Bank
Method Overriding & Overloading
Overriding
Example of method overriding
Overloading
Method Overloading: changing no. of arguments
Method Overloading: changing data type of arguments
Method Overloading: changing data type of arguments