You are on page 1of 17

Lecture 01

OBJECT ORIENTED PROGRAMMING


CST 124-2
Department of Computer Science & Technology

nisal@uwu.ac.lk
Course Outline
1. Introduction to Classes and Objects
2. Control Statements
3. Methods
4. Arrays
5. Classes and Objects
6. Object-Oriented Programming:
• Inheritance
• Polymorphism
• Encapsulation
• Abstraction
7. Files and Streams
8. Exception Handling
Evaluation
• Continuous Assessments : 40%
• End Semester Examination : 60%
• Attendance – 80%
References
• DeitelH.M., DeitelP.J. Java How to program, 7th Edition
------------------------------------------------
• DeitelH.M., DeitelP.J., 2011,
Java: How to program, 9th Edition, Deiteland Associates
------------------------------------------------
• Sierra K. and Bates B., Head First Java, 2005,
2nd Edition, O Reilly’
------------------------------------------------
• https://docs.oracle.com/javase
------------------------------------------------
• Cay S. Horstmann, Core Java Volume I - Fundamentals
(9th Edition)
1. Introduction to Classes and Objects
Evaluation of Programming
Programming – Early stages

• An ordered sequence of instructions


• Writing procedures, functions
• All code is contained in a single continuous block
• Main program directly operates on data
Major Milestones of Programming
• 1952 Grace Hopper wrote the first compiler for the A-0 programming
language.
• In 1957, the first of the major languages appeared. The team led by
John Backus created FORTRAN compiler.
• 1958, John McCarthy of MIT created the LISP. (List Processing language)
• 1960 COBOL was invented.
• C was invented by Dennis Ritchie in 1972.
• Java was invented by Games Gosline in 1991-1995.
Challenges of Early Stage of Programming
• Failed to provide bug free programs
• Difficulty of maintaining
• Reusability issues
• Less security concerns
Software should address;
• Dependability (Trustworthy)
• Maintainability
• Reusability
• Portability
• Security
• Integrity
• User friendliness of S/W
• Cost effectiveness / Time of production
Object Oriented Paradigm
What are objects?
• Objects are real-world entities with states and behaviours.

• States - Data (Attributes)


• Behaviours - Data manipulating methods
Objective of Object Oriented Paradigm
• To model the complex problems in the real world using objects
and finding solutions through their manipulations.
Grouping objects - Classes
• Class – A class is a category or group of things that have similar
attributes and common behaviours.
Animal Class Musical Instrument Class

Vehicle Class Fruit Class


OOP – What is a Class?
• A class describes all objects of a particular kind in an abstract way.
• A class is a blueprint from which objects are created.
Classes & Objects
• Class – A class contains all the information related to a particular
category of objects that have similar attributes and common
behaviours
• Object – Created using the class (blueprint) of that object type

You might also like