Upload
abhilash-nair
View
689
Download
0
Embed Size (px)
Citation preview
- A N K ITA K A R IA
REVISION
TOPICS TO COVER:-
BACKGROUND.
Difference between Structured & Object
Oriented Programming
Basic OOPs Concepts.
History of JAVA.
JAVA Buzzwords (FEATURES).
BACKGROUND
Since the invention of the computer, many programming
approaches have been tried. These include techniques such as:-
Structured Programming. * Modular
Programming
Object Oriented Programming * Top-Down &
Bottom-Up.
The primary motivation in each case has been the concern to
handle the increasing complexity of programs.
BACKGROUND (Contd..)
PASCAL & C are 3rd Generation Languages which use
sequential code, global data, local data & sub-programs.
They follow STRUCTURED PROGRAMMING
Modular Programming
Supports
• Follows TOP-DOWN Approach..
• Failed when programs grew larger, Didn't gave bug-free programs.
SO CAME Object Oriented ProgrammingOOPS
Object-Oriented Programming
Is an approach which attempts to eliminate some of the pitfalls of conventional methods by incorporating the best of structured programming features with several new concepts .
Languages that support OOPs features
include:-
Simulate, Ada, Smalltalk;
C++, Bjarne Stroustrup, 1980 AT&T Bell Labs,
USA
Java, James Gosling, 1996 Sun Microsystems,
USA
C#, Anders Hejlsberg, 2000 Microsoft, USA
Difference between STRUCTURED & OOPs
STRUCTURED PROGRAMMING
OBJECT-ORIENTED PROGRAMMING
Top-down approach is followed.
Bottom-Up approach is followed.
Program is divided into a number of sub-modules or functions or procedures.
Program is organized by having a number ofclasses and objects.
Function call is used. Message passing is used.
Software reuse is not possible.
Helps in software reuse.
No encapsulation. Data and functions are separate.
Data and functionalities are put together in a single entity.
BASIC OOPs CONCEPTS
OBJECT:- Is anything having crisply defined conceptual boundaries.
Represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem domain.
OrAn "object" is anything to which a concept
applies.Contains DATA and METHODS
An object is like a black box.
The internal details are hidden.
Daria
BANKACCOUNT
BASIC OOPs CONCEPTS (Continued…….)
CLASSES:- A class is the blueprint from which individual objects are created.
A class defines features of objects.A feature may be DATA or OPERATION
Variables Functions or methods.
OBJECTS
VEHICLE
CLASS
Model_Type.Manufacture_Date.Speed etc….
Change_Gear.Brake. Etc….
Model_Type.Manufacture_Date.Speed etc….Change_Gear.
Brake. Etc….
BASIC OOPs CONCEPTS (Continued…….)
Example: class Vehicle { int Model_Type; int Man_Date; int speed;
void change_gear(); void brake();
}
VEHICLE
CLASS
Change_Gear.Brake. Etc….
Model_Type.Manufacture_Date.Speed etc….
DATA
Operations OR functions
CREATING OBJECTS:-Vehicle alto; Declares objectAlto = new Vehicle(); -- Allocates Space.Vehicle alto = new vehicle(); - Does Both.
CLASS OBJECT
Class is a data type Object is an instance of class.
It generates objects It gives life to CLASS
Does not occupy memory location
It occupies memory location.
It cannot be manipulated because it is not available in memory
It can be manipulated.
Difference betweenObjects &Classes
ENCAPUSLATION:- The wrapping up of data and methods into a
single unit (called class) is known as ENCAPUSLATION.
Encapsulation makes it possible for objects to be treated like
“black boxes” ,each performing a specific task without any
concern for internal implementation..
ABSTRACTION:- Abstraction is a design technique that focuses
on the essential attributes and behaviour. It is a named collection of
essential attributes and behaviour relevant to programming
BASIC OOPs CONCEPTS (Continued…….)
Explain basic concepts of Object Oriented
Programming?
Distinguish between:-
◦Object oriented and Procedure oriented
programming.
◦Objects and Classes.
QUESTIONS