Page 27 - CA_Blue( J )_Class10
P. 27
02 ELEMENTARY CONCEPT OF
OBJECTS AND CLASSES
Learning Objectives
2.1 Class in Java 2.2 Object 2.3 Properties of Class and Object
Object-oriented programming allows us to develop programs by using the concept of class and object. The basic
structure of java programs is encapsulated in a class. A class consists of characteristics and behaviours which are used
to create objects.
For example, if 'computer' is a class then Supercomputer, Mainframe computer, Minicomputer, Desktop and Laptop
are the objects which can use the properties of the computer class.
class name: COMPUTER
Let us take COMPUTER as a class. It has different characteristics Speed, Storage, Characteristics:
Portability, etc. where one of its behaviour is processing.
Speed
Now, we can consider the different types of computers, such as Supercomputer, Storage
Mainframe computer, and and Minicomputer as different objects. This is Portability
because all the types have a different speeds and storage capacities, and also Behaviour:
some are portable, such as laptops, whereas some should be fixed, such as Processing
supercomputers.
Computer Class
Supercomputer Desktop Laptop
Characteristics: Characteristics: Characteristics:
Speed = 415.53 PFLOPS Speed = 1.5 GHz approx Speed = 1.5 GHz approx
Storage = 200 to 300 gigabytes Storage = 1 to 4 terabytes Storage = 1 terabytes
Portability = fixed Portability = heavy but can be Portability = can be taken
shifted to other position anywhere
Behaviour:
Processing = parallel processing, Behaviour: Behaviour:
so very fast Processing = serial processing Processing = serial processing
25
Elementary Concept of Objects and Classes 25

