You are on page 1of 2

7/22/23, 6:14 PM CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A, Multiple Choice Questions

c) Direct memory locations


d) Random memory locations
Answer: Sequential memory locations.

Question: Identify the incorrect declaration of arrays from the following.

a) Int a[50];
b) Float values[10] [20];
c) Double a[50];
d) Int score [10, 15];
Answer: Int score [10, 15];

Question: Array is used to represent the following.

a) A list of data items of different data types


b) A list of data items of real data type.
c) A list of data items of same data type..
d) A list of data items of integer data type
Answer: A list of data items of same data type..

Question: Array are passed to a function argument by_______

a) Value
b) Reference
c) Both value and reference
d) None of these
Answer: Reference

Question: An array a[8] will store how many values ?

a) 8
b) 7
c) 9
d) 0
Answer: 8

Question: If an array is declared as a a[10], then its elements will be stored as_______

a) a[l] to a[10]
b) a[l] to a[9]
c) a[0] to a[9]
https://www.studiestoday.com/mcq-computer-science-cbse-class-12-computer-science-classes-and-objects-java-mcqs-set-312647.html 23/40
7/22/23, 6:14 PM CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A, Multiple Choice Questions
d) a[0] to a[10]
Answer: a[0] to a[9]

Question: The index or subscript value for an array of size n ranges from

a) 1 to n-1
b) 0 to n-1
c) 1 to n
d) 0 to n
Answer: 0 to n-1

Question: If a static array is not initialized, the elements will be set to_________

a) 0
b) A float number
c) An undetermined value
d) A character constant
Answer: 0

Question: If 'a' is the object of String class and its content is "AHMEDABAD", then what is the value of str.length()?

a) 9
b) 10
c) 8
d) 11
Answer: 9

Question: If 'a' is the object of String class and its content is "C IS A LANGUAGE", then what is the value of str.length()

a) 14
b) 15
c) 12
d) 11
Answer: 15

Question: What type of value is returned when we use get method of Calender class with constant MONTH ?

a) Char
b) String
c) Int
d) Boolean!
https://www.studiestoday.com/mcq-computer-science-cbse-class-12-computer-science-classes-and-objects-java-mcqs-set-312647.html 24/40

You might also like