You are on page 1of 10
. =a, ae eS 7 ee Review Insight | Xe j | @ Why an object is called an instance of a class? [1CSE-2010) Ans: Since, an object possesses instant variables and member methods defined within the lass. Hence, an object is called an instance of, a class. (b) What is the difference between an offect and a ines? [ICSE-2011] Ans, The differences between an object and class are: ____cus sd It is a representation of ii i b: i an| 1, It is a real and unique entity, | abstraction only. having some characteristics and — == : behaviours. i | 2. ttis an object producer and hence 2. It is created with the use of the called i ‘t oes blue print for a set of ‘new’ operator. 3. It is known as ‘Object Factory’. | 3. It is known as an ‘Instance of a | (©) How are Class and Object inter-related? [ICSE MODEL] 4 Ans. a is used to create various objects which possess same characteristics and x ehaviour defined within it. So, we can say that class is a blue print or prototype of an object. Thus, each object follows all the features which are defined within the class. eB, big Cor is the class with the characteristics colour, model and version, then White, Swift DZire, Diesel are used as objects of the class ‘Car’. j f Ans. Java statement to create an object mp4 of class digital: | i digital mp4 = new digital( ); (e) Why is a class called an object factory? [ICSE 2009) _ Ans. Class is used to produce or create various objects containing common attributes and behaviour. Hence, class is called an object-factory. . » Why is a class known as composite data type (USA ay ah [ICSE 2009] Ans. A class is a tool to create user defined data type. The class name becomes the data type for the instances used in the program. It is such a data type that includes various predefined data types within it. Hence, the class is said to be a composite data type. What is ignificance of using the word ‘new’ while creating an object? (g) at is the signific ig eon it allots space in the (@) Write a Java statement to create an object mp4 of class digital. [ICSE 2013} ‘Ans. ‘New’ is used for dynamic allocation of the object, ie., dynamic memory for storage of an object. (h) What is meant by the term attribute? licsE oo Ans. Attribute is defined as the characteristics or the data members available for the objects of a class. It is also referred to as states of an object.

You might also like