2. TOPICS TO COVER:-
BACKGROUND.
Difference between Structured & Object Oriented
Programming
Basic OOPs Concepts.
History of JAVA.
JAVA Buzzwords (FEATURES).
3. 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.
4. BACKGROUND (Contd..)
PASCAL & C are 3rd Generation Languages which use
sequential code, global data, local data & sub-programs.
They follow STRUCTURED PROGRAMMING
Supports
Modular Programming
• Follows TOP-DOWN Approach..
• Failed when programs grew larger, Didn't gave bug-free programs.
SO CAME Object Oriented Programming
5. 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
6. Difference between
STRUCTURED & OOPs
STRUCTURED OBJECT-ORIENTED
PROGRAMMING PROGRAMMING
Top-down approach is Bottom-Up approach is followed.
followed.
Program is divided into a Program is organized by having a
number of sub-modules or number of
functions or procedures. classes and objects.
Function call is used. Message passing is used.
Software reuse is not Helps in software reuse.
possible.
No encapsulation. Data and Data and functionalities are put
functions are separate. together in a single entity.
7. 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
An object is role in the problem domain.
like a black Or
box. An "object" is anything to which a concept applies.
The internal Contains DATA and METHODS
details are
hidden.
BANK
ACCOUNT
8. 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
Model_Type.
Manufacture_Date.
Variables Functions or methods.
Speed etc….
Model_Type. Change_Gear.
Brake. Etc…. VEHICLE
Manufacture_Date.
Change_Gear.
Speed etc….
Brake. Etc….
OBJECTS
9. BASIC OOPs CONCEPTS (Continued…….)
Example:
class Vehicle Model_Type.
{ Manufacture_Date.
int Model_Type; Speed etc….
DATA VEHICLE
int Man_Date; Change_Gear.
int speed; Brake. Etc….
void change_gear(); Operations
void brake(); OR functions
}
CREATING OBJECTS:-
Vehicle alto; Declares object
Alto = new Vehicle(); -- Allocates Space.
Vehicle alto = new vehicle(); - Does Both.
10. 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 It occupies memory location.
location
It cannot be manipulated It can be manipulated.
because it is not available in
memory
11. 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
12. Explain basic concepts of Object Oriented
Programming?
Distinguish between:-
◦ Object oriented and Procedure oriented
programming.
◦ Objects and Classes.