{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Tutorial_3_Sol-for-viewing-printing - a Class b...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CC2203 Data Structures and Algorithms Sem 2, 2009-2010 Page 1 of 2 Tutorial 3 Solutions A1: Object orientation is a system for modeling in terms of the objects which make up a system. It is based on the idea that software systems are best thought of as a set of interacting objects that do the work of the system by sending messages to each other. In object-oriented programming languages, the class construct is used to specify objects. For example, we could define a class to describe the characteristics (which include attributes and methods) of a sheep, then use the class to create numerous sheep objects for a program to simulate a sheepdog trial (competition). Object orientation is one of the most important features of Java programming language. A2: Recall that classes are descriptions or blueprints of objects, while an object is a particular entity (instance) whose properties are described by the class.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a) Class b) Class/Object c) Object d) Object e) Object f) Class A3: (a) An object is a construct in the object-oriented programming. It models a real- world entity and is an encapsulated collection of attributes and methods. The attributes represent the state of the entity and describes the characteristics of the entity. The methods model the behaviour of the entity, which describe the functions that can be performed by the entity. (b) A class groups a collection of similar objects, which have state and behavior in common. A class provides the blueprint of an object and it defines the variables and methods an object will contain when instantiated. Every object is an instance of some class. CC2203 Data Structures and Algorithms Sem 2, 2009-2010 Page 2 of 2 A4: Read the screenshots for compiling the .java files: Read the all .java files....
View Full Document

{[ snackBarMessage ]}