Trending ▼   ResFinder  

ICSE 2009 solved : Computer Applications

37 pages, 9 questions, 0 questions with responses, 0 total responses,    0    0
Manasa Preethi
Sikkim manipal university, Bangalore
Master of Science Information Technology
+Fave Message
 Home > manumansi >

Formatting page ...

ICSE 2009 Q1. (a) Why is a class called a factory of objects? [2 marks] A1. (a) A class is called a factory of objects because it forms the blueprint from which multiple objects can be created. It is like a machine in a factory that keeps on producing objects. We can create as many objects of a class as we wish, with each object having its own set of instance variables. Each object of a class will have the same set of attributes and exhibit similar behaviour. Yet, due to the values of the data members, each is still distinct. Hence, a class is called a factory of objects. Q1. (b) State the difference between a boolean literal and a character literal. [2 marks] A1. (b) BOOLEAN LITERAL CHARACTER LITERAL Data type: boolean Data type: char Values: true or false only Values: any char value Value cannot be converted into an int Value can be converted into an int Space taken up depends on the implementation, and is not known Space taken up is 2 bytes Q1. (c) What is the use and syntax of a ternary operator? [2 marks] A1. (c) The ternary operator is a short-cut for a commonly used implementation of the if else statement. It returns one value if the condition is true, and a second value if the condition is false. The ternary operator is ?: Syntax:

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

manumansi chat