Professional Documents
Culture Documents
Computers Questions 19 21
Computers Questions 19 21
Computers Questions 19 21
b) Calendar
c) Time
d) Date
Answer: Calendar
Question: ______class can be used to extract calendar information like year, month, date, hour, minute and second.
a) Data
b) Calendar
c) Time
d) Date
Answer: Calendar
Question: Like get methods, set methods are used to set the value of the field constants of______class.
a) Data
b) Calendar
c) Time
d) Date
Answer: Calendar
Question: Execution of call 'calendar.set (Calendar.DATE, 20)' will set the date to________
a) Today's date
b) Yesterday's date
c) 20th
d) None of these
Answer: 20th
a) 0
b) 1
c) Null
d) All of these
Answer: 0
a) Int a[50];
b) Float values[10] [20];
c) Double a[50];
d) Int score [10, 15];
Answer: Int score [10, 15];
a) Value
b) Reference
c) Both value and reference
d) None of these
Answer: Reference
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]
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