Mcqs Answers Comp Ganga
Mcqs Answers Comp Ganga
Mcqs Answers Comp Ganga
The intended marks for questions or parts of questions are given in bracketsl I
SECTION A (40 Marks)
(Attempt all questions from this Section.)
Questionl [20]
Choose the correct answers to the questions from the given options.
(Donot copy the questions, write the correct answers only.)
(i)
Polygon
Consider the above picture and choose the correct statement from the following:
(a) Polygon is the object and the pictures are classes
(b) Both polygon and the pictures are classes
\er Polygon is the class and the pictures are objects
(d) Both polygon and the pictures are objects
This paper consists of 11 printed pages and 1 blank page.
T24 861 Turn Over
© Copyright reserved.
(i1) int x =98; char clh=(char)x: what is the value in ch?
(b) A
(c) B
(d) 97
(b) 7
(d) (-1)
(iv) The access specifier that gives least accessibility is:
(a) package
(b) public
(c) protected
v private
(v) The output of the statement "talent".compareTo("genius'") is:
(a) 11
(b) -11
(c) 0
d 13
(vi) Which of the following is an escape sequence character in Java?
(a) /n
(c) /t
(d) //n
T24 861 2
(vii) if (a>b&&b>c) then largest number is:
(a) b
(b) c
a
(c) 12.0
(d) 9.0
(a) exe
(b) obj
(c) jvm
v java
(xi) The number of bytes occupied by a character array of four rows and three
columns are:
(a) 12
t 24
(c) 96
(d) 48
(b) char
xe String
Lay double
2. while
3. do..while
4 switch
(a) only 1
o 1and 2
(c) 1and 3
(d) 3 and 4
(a) yellow
(b) YELLOW
(c) Yell
a) Yellow
T24 861
4
(xvi) Invoking a method by passing the objects of a class is termed as:
a Callby reference
(b) Callby value
(c) Call by method
(d) Callby constructor
(xvii) The correct statement to create an object named mango of class fruit:
(a) Fruit Mango= new fruit();
(xviii) Assertion (A): Static method can access static and instance variables.
(b)
(c) 3
(d) 2
integer?
an
returns only
(Xx) Which of the following mathematical methods
(a) Math.ceil(n)
(b) Math.sqrt(n)
(c) Math. floor(n)
Math.round(n)
Question 2
(i) Write Java expression for: 21
la + b|
Va' + b2
(iii) Rewrite the following do while program segment using for: [2]
X= 10; y = 20;
do
X++;
y++;
} while (x<-20);
System.out.println(x *y );
(iv) Give the output of the following
program segment. How many times is the loop
exccuted? [21
for(x=10; x>20;x++)
System.out.println(x):
System.out.println(x*2);
T24 861