Professional Documents
Culture Documents
CH - 1 Revision Class 9
CH - 1 Revision Class 9
AWHILE loop in Java executes the statements at (a) Break (b) Switch
22
even the condition is not satisfied (c) Continue
least once (d) Loop
(b) False 36. AWT stand
(a) True
for
What is the output ofa Logical
is
OR (1) operation if (a) All Window Tools
the inputs/operands true
one of (b) All Writing Tools
(a) True (b) False (c) Abstract Window Toolkit
carn return a value
4 Constructor (d) Abstract Writing Toolkit
(a) True (b) False 37. Valid declaration of a char is
5 A loop in Java generally contains a Loop-Counter (a) char ch ="\utea'; (b) char ca
='tea';
variable.
(c) char cr \u0223;=
(d) char cc =
"\itea';
(a) True (b) False
38. types of polymorphism
invented OOPS.
26. (a) 3 (b) 2
(a) Alan Kay (b) Dennis Ritchie
(c)5 (d) 4
(c) Adele Goldberg (d) Andrea Ferro
39. User-defined structure adds the function of
27. An OOPS program
can contain no of
encapsulation
classes.
(a) True (b) False
(a) Only 999 (b) Only 100
40. To find the square of a number, Which of the
(c) Only 1 (d) Any number following statement is false
28. The object cannot be_
(a) Math.pow(a,2) (b) Aa
(a) passed by value (b) passed by copy (c) Math.sqrt(a,2) (d) All of the above
(c) passed by function
41. Java compiler javac translates Java source code
(d) passed by reference into
29. The Java program use to find and
(a) Assembler language
fix bugs
(b) Byte code
(a) JDB (b) JRE (c) Bit code
(c) JVM (d) JDK
(d) Machine code
30. Byte Data Type range is .
42. In Java,character constant's value is its
a integer
(a)-128to 128 -127 to 128
(b) value in the character set.
(c)-128to 127 (d) -127 to 127
(a) EBCDIC b) Unicode
1. Size of integer in Java Programming (c) ASCII (d) Binary
is 43. An abstract data type typically comprises a
(a) 8 Bytes (b) 1 Bytes and a set of_ respectively.
(c) 2 Bytes (d) 4 Bytes
(a) representation, classes
Data
methods of
2 To access the instance variables and (b) Database, operations
is used
class objects in java, (c) Data representation, objects
(b) instance of
(a) dot operator() (d) Data representation, operations.
(d) conditional
(c) bitwise
operator decreases the value by_ ProgrammingBased Question
number A4. What is the result of the expression float a =35/0?
(a) ) hello
Output of the above will be
(a) 14 (b) 0 (ii) class
(c) 7 (d) 8 (ii) void
(d) i)k=i
i ) i* = k;
(?)
public static void main((b) (i) x=(c>d) ? d: d;
argsl) (i) x = (c>d) ? c: c;
ii) x = (c >d) ? d: c;
int x=(c) y-(d) (iv) x = (c >d) ? c:d;
(b) ?:are
while(x=y) G) Conditional operators'
(ii) Arithmetic operators
y= (e).
(iii) Bitwise operator
System.out.println(y); (iv) Assignment operator
(c) If else Statement
(i) One-way selection statement
(ii) Two-way selection statement
(a) (i) class
(ii) Multi-way selection statement
(ii) calculate
(ii) void
(iv) Multipath decision statement.
(b) i) string (d) What is the other name for (? :) Question Mak
Colon Operator.?
(ii) void
(ii) calculate () Comparison Operator
(i) IE-Else Operator
(c)i)x=50 (ii) Binary Operator
(i) x = 5
67. Read the given below and answer the questions operators of equal precedence seem in a Simia
given below expression, a rule must govern, which is asses
first. the
Conditional operators are
merely a condensed Entirely binary operators except pr
to
form of the if-else Statement which also
returns
assignment operators areassessed from ft
a value. Conditional right; assignment operators are evaluateu
night
Operators Java are also
in
to the left. *= operator. It us
known as ternary operators. The term is
ternary assignment
an
the
is used because this operator consists an
arithmetic operator like +,
of three or a
operands used to evaluate Boolean expressions. assignment operator (a single'=).
The ultimate aim of the operator is to
decide (a) int k-1,i-2;
which value is to be assigned to the
variable,
The Java Conditional Operator selects one of
while(+i<6)
two k-i;
System.out.println(k); the switch statement
Predict the output (a) int main()
() 30 ii) 60
(C) return 0;
(i) Increment operator
(ii) Decrement operator
(ii) Arithmetic operator Predict the output
(i) RABBIT
(iv) None of the above
(ii) RABBIT is printed an unlimited number of
(d) Types of Integers are. times.
) short (ii) int (ii) No output
(ii) long (iv) all of the above
(iv) Compiler error
69. While workingwith loops, it is sometimes
needed to skip some statements inside the loop
(b) Loops in are implemented using.
or terminate the loop immediately without
i) While Block (ii) For Block
examining the test expression. In such cases, (ii) Do While Block(iv) All the above
break and continue statements are used. Break (c) What is the way to come out of or Quit any
statement in Java terminates the loop immediately, Loop suddenly
and the program's control transfers to the next ) quit; statement
statement following the loop. It is almost used (ii) leave; Statement
with decision-making statements (Java if..else (ii) break; statement
Statement). It can be used to terminate a case in
(iv) continue; Statement