Docsity

Introduction to Object oriented programming, Slides of Computer science

Partial preview of the text

Download Introduction to Object oriented programming and more Slides Computer science in PDF only on Docsity!

Introduction to Java & Bluej Environment

Object Oriented Programming

  • (^) Provides easy approach
  • (^) Machine independent
  • (^) Understanding is very easy

High level

languages

  • (^) Many instructions are written
  • (^) Instructions are grouped together to form functions
  • (^) Concentrates much on data items rather than functions

Procedure

oriented

  • (^) Modular approach
  • (^) Standardize the program by creating partition memory for both data and function
  • (^) Reusability of code

Object

oriented

Principles of Object Oriented Programming Objects Classes Data Abstraction Encapsulation Inheritance Polymorphism Dynamic Binding

Object Characteristic : Colour and shape Behavior : Write Characteristics are considered as data members Behavior is considered as functions

Classes

  • (^) Class is a set of similar objects
  • (^) Each object has its own attribute and common behavior Rainbow is a class that contains amplitude, frequency, wavelength. Objects are the different colors

Data Abstraction

  • (^) Act of representing the essential features without including the background details When you buy a car, you see only the features in the car and not internal parts of the car

Real-world examples The second example, consider an ATM Machine; All are performing operations on the ATM machine like cash withdrawal, money transfer, retrieve mini-statement…etc. but we can't know internal details about ATM

Real-world examples The second example, consider an ATM Machine; All are performing operations on the ATM machine like cash withdrawal, money transfer, retrieve mini-statement…etc. but we can't know internal details about ATM

Inheritance

Process by which objects of one class can link and share some common properties of objects from another class. All Grade 9 in the school share the same publisher book

9 A 9 B 9 C

Polymorphism

  • (^) Process of using a function for more than one purpose.

Types of java Programming Stand alone or Java Application

  • (^) A program that is developed by the user Internet Applets
  • (^) A program downloaded from the internet

Compiler and Interpreter Compiler/ Interpreter Source code Machine code

Features of Java

o Java is an object oriented programming language

o It is both compiled and interpreted

o It is platform independent

o It is case sensitive

o Access data from local system as well as from the net

What is a computer program? A software program is commonly defined as a set of instructions, or a set of modules or procedures, that allow for a certain type of computer operation