Java Learning Made Easy

150 0 0
                                    

COMPUTER APPLICATIONS

Tutorial

on JAVA

Dheeraj Mehrotra

City Montessori School & Degree College

Lucknow (India)

attention@computerscienceexpertise.com

www.computerscienceexpertise.com Towards QUALITY IT LITERACY FOR ALL

PDF created with pdfFactory Pro trial version www.pdffactory.com

Concept of OOP

o OOP

stands

for

Object

Oriented

Programming. It is the latest trend in

programming languages supported by C++

and Java and has had the revolutionary

success in the race of OOP. The limitations

of the Procedure Oriented Programming

(POP) languages, have given place to the

development of the OOP.

attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com

CLASSES & OBJECTS

Object :

An object is an identifiable entity with some characteristic and behaviour. o

Class :

A Class is a group of objects that share common properties and relationships.

The Objects are variables of type Class eg.

If animal has been defined as a Class, then the statement; o

animal dog;

will create an Object featuring dog belonging to the class animal.

attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com

CORE CONCEPTS OF OOP

o The basic concepts of Object Oriented

Programming (OOP) are :

n Abstraction

n Encapsulation

n Inheritance

n Polymorphism

attention@computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com

Features of OOP

Abstraction refers to the act of representing essential features without including the background details or explanations. o

Encapsulation is an act of wrapping up of data and methods into a single unit (called class). It is one of the most fundamental concepts of the Object Oriented programming. The very insulation of the data from direct access by the program is termed as Data Hiding. Encapsulation, is hence, just a way to implement Abstraction.

Inheritance is the process by which objects of one class acquire the properties of objects of another class. This further provides an important extension to the idea of reusability. i.e. a particular programmer can make use of an existing class and without any further modifications, add additional features and capabilities to it, by deriving a new class from the existing one, through inheritance.

Java Learning Made EasyTahanan ng mga kuwento. Tumuklas ngayon