Lect 0ne
Lect 0ne
Lect 0ne
• Characteristics of OOD
Objects are abstractions of real-world or system entities
and manage themselves
Objects are independent and encapsulate state and
representation information.
System functionality is expressed in terms of object
services
Shared data areas are eliminated.
Objects communicate by message passing
Objects may be distributed and may execute
sequentially or in parallel
Java – Basics of objects
• Interacting objects
o1: C1 o3:C3 o4: C4
state o1 state o3 state o4
ops1() ops3 () ops4 ()
• System.out.print();
Escape Sequence
Memory Concepts
• Variable names correspond to locations in the
computer’s memory. Every variable has a name,
a type, a size (in bytes) and a value.
• Eg: number1 = input.nextInt(); // read the
number from the user.
• Scanner class enables program to read data
from the user.
• Its declaration:
• Scanner input= new Scanner(System.in)