Assignment 1
Assignment 1
features of java
Explain the characteristics/principals of
Object Oriented Programming
Object-oriented programming generally referred to as OOPS is the
backbone of java as java is not a purely object oriented language but
it is object oriented language. Java organizes a program around the
various objects and well-defined interfaces. There are four pillars been
here in OOPS which are listed below. These concepts aim to
implement real-world entities in programs.
Abstraction
Encapsulation
Inheritance
Polymorphism
Abstraction
Abstraction is a process of hiding implementation details and
exposing only the functionality to the user. In abstraction, we deal with
ideas and not events. This means the user will only know “what it
does” rather than “how it does”.
There are two ways to achieve abstraction in Java:
Abstract class (0 to 100%)
Interface (100%)
Encapsulation
not store the negative values for an Integer. So by this way we can
control the data.
Data Hiding: The data members are private so other class can’t
Inheritance
both are superclass and C is only one child class. Java is not
supporting Multiple Inheritance, but we can implement using
Interfaces.
Hybrid Inheritance: Class D inherits class B and class C. Class B
Polymorphism
Defau
Assert Goto public Try
lt
Boole
Do If Static throws
an
Exten instanceo
Catch return void
ds f
synchroniz volatil
Char Final Int
ed e
package com.tutorialspoint;
package com.tutorialspoint;