0% found this document useful (0 votes)
50 views21 pages

EM STD 12 CH 7 - Solution-1

Uploaded by

sagarsmit200809
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views21 pages

EM STD 12 CH 7 - Solution-1

Uploaded by

sagarsmit200809
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Date : 19-10-2024 STD 12 Science COMPUTER Total Marks : 190

* Choose The Right Answer From The Given Options: [190]

1. Which of the following is complied error free ?


(A) for(;;){int i=7}; (B) While (1) {int (C) while (True){int (D) All of these
i=7}; i=7};
Ans. : All of these
2. What will be the result of arithmetic expression -7%2 ?
(A) – 3 (B) – 1 (C) 1 (D) – 3.5
Ans. : – 1
3. Java language is developed after …………. language.
(A) C (B) C ++ (C) COBOL (D) FORTRAN
Ans. : C ++
4. Which type of program codes can be written using Java ?
(A) Object oriented (B) Flexible (C) Reusable (D) All of these
modular
Ans. : All of these
5. All classes of Java library are written in ……… .
(A) Java (B) Linux (C) Unix (D) C language
Ans. : Java
6. What will be the result of arithmetic expression 7/2 ?
(A) 3 (B) 3.5 (C) 1 (D) 0
Ans. : 3.5
7. At ………. Level, platform-independence is possible due to byte code interpreter.
(A) Source (B) Binary Level (C) Hexa level (D) None of these
Program
Ans. : Binary Level
8. Minimum how many classes are required in Java program ?
(A) 2 (B) 3 (C) 4 (D) 1
Ans. : 1
9. Bytecode file has ………. Extension.
(A) .java (B) .jdk (C) .class (D) javac
Ans. : .class
10. …………. Compiler makes the bytecode file in Java language.

Page 1
(A) jdk (B) javac (C) ecj (D) None of these
Ans. : javac
11. How to Compile Java source file in SciTE editor ?
(A) (B) Tools 2 Compile (C) Edit 2 Compile (D) File 2 Compile
Option 2 Compile
Ans. : Tools 2 Compile
12. ………… is not valid for the name of the class.
(A) Call Cost (B) interest (C) Call Range (D) Area
Ans. : Call Range
13. What is the default value in byte data type ?
(A) 1 (B) 0 (C) 128 (D) 255
Ans. : 0
14. In which data type default value is false ?
(A) float (B) short (C) Boolean (D) char

Ans. : Boolean
15. Changing of data during the cause of the program is called ……….. .
(A) data change (B) Type-cast (C) change data (D) None of these

Ans. : Type-cast
16. If numeric literal is preceded with ……….. then it becomes octal value.
(A) L (B) l (C) OX (D) O
Ans. : O
17. How many clear literals are there for Boolean ?
(A) 2 (B) 3 (C) only one (D) 4
Ans. : 2
18. In C language, non zero value is known as ………. .
(A) true (B) false (C) zero (D) constant value

Ans. : true
19. How are the basic arithmetic operators in Java ?
(A) Binary (B) Octal (C) Hexadecimal (D) Decimal

Ans. : Binary
20. 8 % 3 will give ………… output.
(A) 1 (B) 2 (C) 3 (D) 4

Ans. : 2
21. Comparison Operator give ………… result.

Page 2
(A) Numbered (B) Boolean (C) 0 (D) > 0

Ans. : Boolean
22. What is the default data type of floating point literal?
(A) float (B) double (C) int (D) long

Ans. : double
23. Which character set is used for char data type in Java?
(A) Unicode (B) EBCDIC (C) ASCII (D) All of these
Ans. : Unicode
24. Which of the following is compiled error free?
(A) for (; ;) {int i = 7}; (B) while (l) {int i=7>;
(C) while (True) {int i = 7}; (D) All of these

Ans. : for (; ;) {int i = 7};


25. What will be the result of arithmetic expression-7%2?
(A) —1 (B) —3 (C) 1 (D) — 3.5
Ans. : —1
26. On which programming language is Java based?
(A) Object (B) Web
(C) Animation (D) Spreadsheet
Ans. : Object
27. After which language is Java language developed?
(A) C++ (B) VB (C) PHP (D) Net

Ans. : C++
28. What was the level at which was Java language designed to be portable across
platform operating system?
(A) Source Program (B) Binary (C) a and b both (D) None of these

Ans. : a and b both


29. Which was the platform and operating system across which Java language was
designed to be portable at the source and at the binary level?
(A) Only one (B) Different
(C) Only on Linux (D) Only on Mac 0s
Ans. : Different
30. Which language is very similar to Java syntax?
(A) C (B) VB (C) PHP (D) Net

Ans. : (C) PHP

Page 3
31. Which of the following languages is considered as one of the ideal languages
for distributing executable programs via the World Wide Web?
(A) ASP.NET (B) Java (C) PHP (D) VB.NET

Ans. : Java
32. Which of the following languages is considered as a general — purpose
programming language?
(A) Java (B) PHP (C) ASP.NET (D) VB.NET

Ans. : Java
33. Which type of language is Java considered?
(A) For distributing executable programs via the www
(B) Easily usable across different platforms
(C) General-purpose for developing programs that is portable
(D) All of these

Ans. : All of these


34. How does Java differ from C language?
(A) Java is object oriented. (B) Animation is possible in Java.
(C) Java uses only CLI. (D) None of these

Ans. : Java is object oriented.


35. In Java, which of the following is provided by set of class libraries?
(A) System input and output (B) Basic data types
capabilities (C) Other utility functions
(D) All of these

Ans. : All of these


36. For which of the following tasks there are many classes in Java?
(A) Common Internet protocols (B) Networking
(C) User interface toolkit function (D) All of these

Ans. : All of these


37. Which is the language in which Java libraries classes are written?
(A) Java (B) PHP (C) C (D) HTML

Ans. : Java
38. At which of the following both levels doe Java platform remain independent?
(A) Source program and Binary
(B) Source program and Octal
(C) Source program and Hexadecimal

Page 4
(D) Source program and Assembly

Ans. : Source program and Binary


39. Which combination do the designers of java choose to use?
(A) Compilation and (B) Interpretation (C) Compilation and (D) None of these
Interpretation and Loading Loading

Ans. : Compilation and Interpretation


40. What type of computer is a computer that doesn’t really exist called?
(A) Dream (B) Virtual (C) Imaginary (D) Artificial

Ans. : Virtual
41. What is referred to as a Java virtual computer?
(A) JVM (B) JIK (C) JRE (D) JAV
Ans. : JVM
42. Which is the form of Java binary files actually?
(A) Byte Code (B) Code (C) Virtual Code (D) Vcode

Ans. : Byte Code


43. Which type of Java bytecode interpreter is needed for each type of computer?
(A) Different (B) According to OS (C) Same (D) None of these

Ans. : Different
44. What is the disadvantage of using a bytecode?
(A) Its slow execution speed. (B) Its medium execution speed.
(C) Its fast execution speed. (D) It cannot be execute
Ans. : Its slow execution speed.
45. Which of the following is used to convert java bytecodes into native code?
(A) Tools (B) Kernel (C) Code Engine (D) None of these

Ans. : Tools
46. How is native code to execute?
(A) Fast (B) Slow (C) Slower (D) Medium

Ans. : Fast
47. ‘Which code is faster to execute but it does not remain machine independent?
(A) Byte code (B) Native code
(C) Script code (D) None of these
Ans. : Native code
48. How many minimum classes should a Java program have?
(A) One (B) Two (C) Three (D) Four

Page 5
Ans. : One
49. Which method is a must in a Java program?
(A) write0 (B) open0 (C) show0 (D) main0
Ans. : main0
50. Which of the following language’s programmers can think of a class as a sort of
creating a new composite data type by using ‘strict’ and ‘typedef’?
(A) C (B) Java (C) Basic (D) Cobol

Ans. : (C) Basic


51. Using what can “C” programmers think of a class as a sort of creating new
composite data type?
(A) strict (B) typed
(C) a and b both (D) none of these

Ans. : a and b both


52. Which of the following type is not available in Java?
(A) typedef (B) char (C) int (D) Boolean
Ans. : typedef
53. Which of the following programs is used to create Java source file?
(A) ASCII Text Editor (B) Impress (C) Calc (D) Latex
Ans. : ASCII Text Editor
54. In Java, what kind of file is a file with .class extension?
(A) Bytecode (B) Virtual (C) Octal (D) Hexadecimal

Ans. : Bytecode
55. In which of the following, the Java Interpreter is called simply using java?
(A) JDK (B) JKD (C) JRE (D) JAK
Ans. : JDK
56. Which code is not needed to execute Java program?
(A) Source (B) Class (C) JDK code (D) None of these
Ans. : Source
57. What name should be of source file when class is public?
(A) As the Class (B) Starts with java (C) Ends with java (D) Any
name

Ans. : As the Class name


58. Which file name is the same as the class name containing main method?
(A) Bytecode file (B) Installer file (C) None of these (D) JRE file

Page 6
Ans. : Bytecode file
59. In which routine is the body of the program contained?
(A) class0 (B) main0 (C) java0 (D) first0

Ans. : main0
60. Which of the following methods takes a value to be displayed as an argument?
(A) System.out.print (B) System.out.println
(C) a nd b both (D) None of these

Ans. : a nd b both
61. Which of the following methods adds a linefeed after the end of the information
that is displayed?
(A) System.out.prinln (B) System.out.print
(C) System.println (D) System. Print

Ans. : System.out.prinln
62. In which symbol is the string literal enclosed in System.out.print0 method?
(A) Single Quote (‘‘) (B) Double Quote (““)
(C) Back Quote (‘‘) (D) None of these

Ans. : Double Quote (““)


63. Which of the following routines determines how and in what order the other
subroutines are used?
(A) main0 (B) window0 (C) document0 (D) system0
Ans. : main0
64. Which command is given to compile the source program in Site Editor?
(A) Tools→Compile
(B) File →$ Compile -4 Sources
(C) File → Compile
(D) Tools→Compile→ Source
Ans. : Tools→Compile
65. Which command is given to execute program in Site Editor?
(A) Tools→Go
(B) File→Go
(C) Tools→Run
(D) Tools → Execute

Ans. : Tools→Go
66. By using what do the syntax rules specify how programs can be constructed?

Page 7
(A) Variable, expressions (B) Statements, branches
(C) Method, loop (D) All of these
Ans. : All of these
67. What is used to describe something actual we need to type while writing actual
program?
(A) Place holder (<>) (B) []
(C) a and b both (D) None of these
Ans. : Place holder (<>)
68. Which type of language is Java so that everything is defined as part of class?
(A) Object-oriented (B) Multimedia-oriented
(C) Symbol-oriented (D) Array-oriented
Ans. : Object-oriented
69. Whose part can a method be?
(A) Class (B) Data (C) Type (D) Rules
Ans. : Class
70. What is in the first line in structure of a Java Program?
(A) Class name (B) Variable (C) Data type (D) Function

Ans. : Class name


71. Which file is generated when CaIlCost.java file is compiled?
(A) CallCost.class (B) CallCost.main (C) CallCost.jre (D) CailCost
Ans. : CallCost.class
72. By whom can CallCost.class file be executed?
(A) Java Interpreter (B) Java Linker (C) Java Compiler (D) Java Loader
Ans. : Java Interpreter
73. Which of the following is not a part of the syntax of the Java language?
(A) Blank line (B) Indentation (C) a and b both (D) None of these

Ans. : a and b both


74. To whom is program layout important?
(A) Computer (B) Reader (C) Editor (D) All of these

Ans. : Reader
75. Which of the following is an integer number?
(A) -38477 (B) 0 (C) 4.5 (D) a and b both
Ans. : a and b both

Page 8
76. Which of the following data type holds one of the two logical values (true or
false)?
(A) Boolean (B) Char (C) Byte (D) Long

Ans. : Boolean
77. The data types that are built into the system are known as following type of
data type.
(A) Secondary (B) Primitive (C) Main (D) Master
Ans. : Main
78. In which range do the integer numbers with b bits precision store signed
values?
(A) 2111 to 2b-1 (B) 2b to 2b-1 (C) Oto2b_i (D) None of these
Ans. : 2111 to 2b-1
79. By which name is an international standard for defining floating-point numbers
and arithmetic known?
(A) IEEE (B) Unicode (C) ASCII (D) EBCDIC

Ans. : IEEE
80. Because of what can Java use thousands of characters from many different
languages and different alphabets?
(A) It has 16 bits of precision and is unsigned.
(B) It has 8 bits of precision.
(C) It has 4 bits of precision.
(D) None of these
Ans. : It has 16 bits of precision and is unsigned.
81. Which type of data value a variable can take at different times during the
execution of the program?
(A) Only one (B) Different (C) Defined (D) None of these
Ans. : Different
82. Which type of memory location is referred by a variable that can take different
data values at different times during the execution of the program?
(A) Same (B) Variable doesn’t (C) Different (D) Can’t say
have location
Ans. : Same
83. Which kind of variable can only be used in Java?
(A) Declared (B) Undeclared (C) Textual (D) Numerical

Ans. : Declared

Page 9
84. What is the syntax of declaring variable in Java?
(A) \{variable-names (B) \& Type nome > ) variable names;
(C) \{Variable names\}: (D) None of these

Ans. : \{variable -names


85. Which symbol is used to separate items when the list contains more than one
item?
(A) , (B) < > (C) {} (D) ;
Ans. : ,
86. What may be immediately after the first character of the variable name?
(A) Alphabets (B) $ And — (Underscore)
(C) Digits (D) All of these
Ans. : Alphabets
87. Which of the following word has special use in Java?
(A) Reserved (B) Constant (C) Variable (D) None of these

Ans. : Reserved
88. Which of the following are Camel case words?
(A) Balance Amount (B) Birth Date (C) Product (D) a and b both
Ans. : a and b both
89. What can we say for variable names like Balance, balance and BALANCE?
(A) They are Different. (B) First two are same.
(C) They are same. (D) Last two are same.

Ans. : They are Different.


90. Customarily whose name begins with the upper case letter?
(A) Class (B) Variable (C) Method (D) a and both
Ans. : Class
91. Which variables are declared at the point they are first used?
(A) Variables which (B) Variables that (C) Important (D) None of these
are not important store numerical variables
to overall logic of values
the function

Ans. : Variables which are not important to overall logic of the function
92. In which is the item declared optional in the syntax of variable declaration?
(A) <> (B) {} (C) [ ] (D) All of these
Ans. : [ ]

Page 10
93. Which is the name used for a constant value?
(A) String (B) Literal (C) Boolean (D) Float
Ans. : String
94. Which of the following is a numeric literal?
(A) 17.5 (B) 157 (C) Both a and b (D) \n

Ans. : Both a and b


95. Into which integer literal a decimal integer literal larger than int is automatically
converted?
(A) Long (B) Double (C) Byte (D) Char
Ans. : Long
96. What is to be appended as a suffix to the number so that we can force a smaller
number to be a longer one?
(A) L (B) 1 (C) long (D) a or b
Ans. : a or b
97. Which of the following is a legal octal number?
(A) 83 (B) 45 (C) 0x45 (D) A7
Ans. : 45
98. What is the decimal value of octal number 045?
(A) 37 (B) 38 (C) 39 (D) 30

Ans. : 37
99. In hexadecimal, which digits represent, letters A to F respectively?
(A) l0 t ol5 (B) 8 to 14 (C) 11 to 16 (D) 9 to 15
Ans. : l0 t ol5
100. What is used as prefix for hexadecimal literals in Java?
(A) Ox or OX (B) 0 (C) X or X (D) L or 1
Ans. : Ox or OX
101. Which of the following literal consists of \u followed by four hexadecimal digits?
(A) Character (B) Unicode (C) Numeric (D) None of these

Ans. : Unicode
102. What do e12 and 12.373e-108 represent in 1.3e12 and 12.373e-108?
(A) Square of 10 (B) Powers of 10 (C) |Cube of 10 (D) Powers of 2
Ans. : Powers of 10
103. Which of the following literal has default type as double?
(A) Integer (B) Floating-point (C) Unicode (D) Boolean

Page 11
Ans. : Floating-point
104. What should be appended as a suffix to make a literal of type ‘float’?
(A) F or f (B) T or t (C) 0 or 0 (D) L or 1
Ans. : F or f
105. What is written to specify literal 1.2 to be considered as a value of type ‘float’?
(A) 1.2L (B) F—1.2 (C) 1.2F (D) L—1.2

Ans. : 1.2F
106. Which two of the following literals are for Boolean type?
(A) True and false (B) 0 and 1 (C) T and F (D) Y and N
Ans. : 0 and 1
107. In C language, as what are zero and non-zero values treated respectively?
(A) True and false (B) False and true
(C) Positive and negative (D) Negative and positive

Ans. : True and false


108. Which of the following is I are character literals?
(A) ‘a’ (B) ‘#‘ (C) ‘3’ (D) All of these
Ans. : All of these
109. In which expression there can be a literal, a variable, a function call?
(A) Simple expression (B) Complex expression
(C) Composite expression (D) Literal expression
Ans. : Simple expression
110. Which of the following expressions can be built up by using operators to
combine simpler expressions?
(A) Literal expression (B) Composite expression
(C) Complex expression (D) Simple expression
Ans. : Literal expression
111. If we don’t want the default precedence, what is used to explicitly specify the
grouping?
(A) Simple bracket (B) Square bracket (C) Curly bracket (D) None of these
Ans. : Simple bracket
112. Which number is a quotient after operation in a Modulus (%) operator?
(A) Integer (B) Real (C) Negative integer (D) None of these
Ans. : Integer
113. Give result of 9 % 2.
(A) 1 (B) 4 (C) 4.5 (D) 5
Ans. : 1
114. With modulus operator %, what is the result j its first operand is negative? —
(A) Negative (B) Zero (C) a or b (D) Positive
Ans. : Negative
115. Which of the following will be a remainder in 25.8 % 7?
(A) 4.8 (B) 4 (C) 3 (D) 3.68
Ans. : 4.8
116. What is the result of x % y when z = 6 and y = —4?
(A) 2 (B) -2 (C) 1 (D) -1
Ans. : 2
117. What is the result of x / y when x=6 and y=4?
(A) 2 (B) 2 (C) 1 (D) -1
Ans. : 1
118. What the result of a %b when a=12.5 and b=6?
(A) 0.5 (B) 2 (C) 5 (D) 2.5
Ans. : 0.5
119. What will be the result of System.out.println (“x + y =” + x + y); whenx6andy4?
(A) x + y=64 (B) x + y =10 (C) x + y=xy (D) x + y=x + y
Ans. : x + y=64
120. What will be the result of System.out.println (“x +y=” +x +y); whenx6andy=4?
(A) x + y=10 (B) x + y=64 (C) x + y=xy (D) x +y=x + y
Ans. : x + y=10
121. Into which data type will the result of System.out.println (“a/x=” +(a/x)) be;
when a = 12.5 and x 4?
(A) Float (B) Char (C) Int (D) Not Possible

Ans. : Float
122. What is it called when ++ operator is used after variable name?
(A) Post-increment (B) Pre-increment
(C) Pre-decrement (D) Post-decrement
Ans. : Post-increment
123. What is it called when _ _ operator is used after variable name?
(A) Post-decrement (B) Post-increment (C) Pre-decrement (D) Pre-increment

Ans. : Post-decrement
124. What will be the values of x and y after executing y = 4 + x++; if value of x is 3?
(A) 4, 7 (B) 3, 7 (C) 3, 4 (D) 4, 8
Ans. : 4, 7
125. What will be the values of x and y after executing y = 4 + ++x; if value of x is 3?
(A) 4, 8 (B) 4, 7 (C) 3, 7 (D) 3, 4
Ans. : 4, 8
126. What will be the values of x and y after executing y = 4 + x — —; if value of x is
3?
(A) 2, 7 (B) 6, 2 (C) 4, 7 (D) 4, 8
Ans. : 2, 7
127. In how many terms of statement the increment and decrement operator is
used, but the use of pre or post does not make any difference?
(A) Single term (B) More than one (C) Three terms (D) Two terms
Ans. : Single term
128. Which operator is also known as comparison operator?
(A) Relational (B) Logical (C) Arithmetic (D) Unary

Ans. : Relational
129. Which Java statement is used to display variable A and variable B as not equal?
(A) A==B (B) A<>B (C) A B (D) A!= B
Ans. : A!= B
130. Where are relational operators used usually?
(A) In the if statements (B) In the Loop
(C) Both a and b (D) None of these
Ans. : Both a and b
131. Which of the following operators are used to compare Boolean values?
(A) = = (B) ! (C) Both a and b (D) None of these
Ans. : Both a and b
132. Which of the following are logical operators in Java?
(A) And (B) Or, Xor (C) Not (D) All of these
Ans. : All of these
133. Which error would have been there for the value of x is zero in (x!=0) && (y/x>1)
expression?
(A) Division by zero (B) Zero Division (C) Not Possible (D) Error
Ans. : Division by zero
134. How many operands are there in the conditional operator?
(A) Three (B) Two (C) Four (D) One

Ans. : Three
135. Which symbols are used in expression to delimit three operands in the
conditional operator?
(A) ? and: (B) :and; (C) . and: (D) ? an
Ans. : ? and:
136. Which value will be the value of entire expression if the value of first operand is
true in the conditional operator?
(A) Third operand (B) Second operand (C) Fourth operand (D) Anyone
(expression 2) (expression 1) (expression 3)
Ans. : Second operand (expression 1)
137. What will be the value of “next” variable in the expression next = (N % 2 == 0)?
(N/2) (3*N+1) when value of N is odd number?
(A) (3*N+1) (B) NJ2) (C) Error (D) Any one
Ans. : (3*N+1)
138. What does represent in an assignment syntax?
(A) Data value (B) Calculation (C) Both a and b (D) None of these
Ans. : Both a and b
139. Which is the expression in the statement rate = 10.02f?
(A) 10.02f (B) F (C) Rate (D) =
Ans. : 10.02f
140. What does it refer when a variable is used in an expression on the right-hand
side?
(A) To the value (B) To increase the (C) To assign value (D) To decrease the
stored in the value of the variable to the variable value of the variable
variable

Ans. : To the value stored in the variable


141. What does it refer when a variable is used on the left-hand side of an
assignment statement?
(A) File location (B) Input location (C) Memory location (D) Output location
Ans. : Memory location
142. What is a variable called when it is on left-hand side of expression?
(A) Lvalue (B) Revalue (C) Mvalue (D) Pvalue
Ans. : Lvalue
143. From which of the following data type, there may not be automatic conversion?
(A) From smaller to (B) From double to (C) From int to (D) All of these
larger datatype float short

Ans. : All of these


144. Which of the following saves the typing time?
(A) Shorthand assignment (B) Short circuiting
(C) Assignment (D) Boolean assignment
Ans. : Shorthand assignment
145. Which of the following are examples of shorthand assignment operator?
(A) a + = b (B) a && = b (C) a ++ (D) Both a and b
Ans. : Both a and b
146. Which of the following statement is equivalent to the statement a +=b?
(A) a=a + b (B) b=a + b (C) a=a * b (D) a=b+1
Ans. : a=a + b
147. What can we use for conversion that would not be done automatically?
(A) Short circuiting (B) Shorthand (C) Typecast (D) All of these
operator
Ans. : Typecast
148. What should we type in the parentheses before the value we want to convert?
(A) Type-name (B) Type-cast (C) Value (D) None of these
Ans. : Type-name
149. Which operator is operated first when two operators are having different
priority?
(A) Higher (B) Lower (C) Any (D) None of these

Ans. : Higher
150. Which will be the first process in a + b * C 7
(A) a + b (B) b * c (C) a * c (D) a + c
Ans. : b * c
151. How is the precedence of multiplication than addition in action of addition and
multiplication?
(A) More (B) Negligible (C) Less (D) Same
Ans. : More
152. Which of following is used to avoid confusion during calculation?
(A) ( ) (B) { } (C) < > (D) [ ]
Ans. : ( )
153. What does associativity determine?
(A) The direction in which operations (B) The order in which operations are
are performed (Left to Right or Right performed
to Left) (C) Both a and b
(D) None of these
Ans. : The direction in which operations are performed (Left to Right or Right to
Left)
154. From x=y=z=7, what to understand of the following, it will give 7 to value of
three variables?
(A) x = (y = (z = 7)) (B) (x=y) = (z=7) (C) (x=y=z)=7 (D) (x=y=) z=7
Ans. : x = (y = (z = 7))
155. What will be first evaluated in x = y = z = 7?
(A) z=7 (B) x=y (C) y=z (D) x=7

Ans. : z=7
156. How is the expression 72/2/3 treated?
(A) (72/2)/3 (B) 72 / (2/3) (C) (72/3) /2 (D) 72 / (3/2)
Ans. : (72/2)/3
157. Which of the following operator has left-to-right associativity?
(A) ++ (B) = (C) += (D) /
Ans. : /
158. In general, how are the statements executed?
(A) Randomly (B) Ordered
(C) Disordered (D) In descending order
Ans. : Ordered
159. What are those statements known as that enable to control the flow of
execution?
(A) Loop structures (B) Nested (C) Control (D) None of these
structures structures
Ans. : Control structures
160. Which of the following is used to choose among two or more possible courses
of action?
(A) Branches (B) Loops (C) Function (D) Block
Ans. : Branches
161. What is used to group related statements logically?
(A) Block (B) Type-casting (C) Nesting (D) None of these

Ans. : Block
162. What kind of variable is to be when we declare a variable inside a block?
(A) Local to block (B) Local to (C) Global (D) None of these
program
Ans. : Local to block
163. What kind of variable is to be when we declare a variable inside a block?
(A) Inaccessible to outside that block (B) Invisible
(C) Both a and b (D) None of these
Ans. : Both a and b
164. What can a variable to the block be called?
(A) Non-local (B) Local (C) Global (D) None of these

Ans. : Global
165. What happens when we declare a variable with the same name as of the
variable in scope?
(A) There will be an error.
(B) Another variable will be created with the same name.
(C) Another variable will be created with the different name.
(D) None of these
Ans. : There will be an error.
166. What happens when we declare a variable inside other block of program as
same name as declared inside in main () method?
(A) There will be conflict with both variables and error will be displayed.
(B) Textbox for changing name will be displayed.
(C) Variable will be created.
(D) None of these
Ans. : There will be conflict with both variables and error will be displayed.
167. Which of the following statement enables to take one of two alternative courses
of action, depending on whether the value of a given Boolean valued expression
is true or false?
(A) For (B) While (C) Else (D) if
Ans. : if
168. As which of the following control structure is the ‘if’ statement known?
(A) Branching (B) Decision (C) Selective (D) All of these
Ans. : All of these
169. How many statements are there as statement in ‘if’ statement?
(A) One (B) Block (More (C) a or b (D) None of these
than one)
Ans. : a or b
170. What is advisable to use in ‘if’ statement?
(A) Block (B) Typecasting (C) Nesting (D) None of these
Ans. : Block
171. Write Java statement to check whether the value of variable ‘marks’ is greater
than or equal to 70.
(A) If (marks > 70) (B) If [marks > 70] (C) If (m > 70) (D) If (m>=70)
Ans. : If (marks > 70)
172. Which statement is used when there are many alternative actions to be taken
depending upon the value of a variable or expression?
(A) Switch (B) For (C) If (D) While

Ans. : Switch
173. In which of the following statement, the result of the test expression must be of
the type taking discrete values?
(A) Switch (B) For (C) If (D) While
Ans. : Switch
174. Which of the following should be a type of the test expression in ‘switch’
statement?
(A) Byte, char (B) Short, int (C) Enema (D) All of these
Ans. : All of these
175. Which statement does not exist and if there is no match in any of the cases, the
‘switch’ statement completes without doing anything?
(A) Default (B) None (C) Last (D) End
Ans. : Default
176. Which statement is used to break the ‘switch’ statement?
(A) Default (B) Break (C) End (D) Last

Ans. : Break
177. Which types of looping constructs does Java support?
(A) For (B) While (C) Do…while (D) All of these
Ans. : All of these
178. In which loop, it is possible that statements in a loop are not executed at all?
(A) For and while (B) Do…while (C) If and switch (D) All of these
Ans. : For and while
179. Which loop is used usually when number of iterations is predetermined?
(A) While (B) Do…while (C) For (D) All of these
Ans. : For
180. Which is the first expression in ‘for’ loop?
(A) Initialize (B) Condition (C) Iterate (D) Last value

Ans. : Initialize
181. ‘which is the second expression in ‘for’ loop?
(A) Condition (B) Initializer (C) Iterator (D) Last value
Ans. : Condition
182. Which type of loop is the ‘do…while’ loop?
(A) Exit-controlled (B) Post-test (C) Entry-controlled (D) Both a and c
Ans. : Both a and c
183. In which loop, the test expression is evaluated after executing the statements in
a loop?
(A) While (B) Do…while (C) For (D) All of these
Ans. : Do…while
184. Which statement is used in ‘switch’ structure so that it skips all the following
statements and control is transferred at the first statement after the end of
‘switch’ statement?
(A) Continue (B) Default (C) Break (D) Go
Ans. : Break
185. To exit from what, is the break statement in loop to be used?
(A) Program (B) Editor (C) Loop (D) All of these
Ans. : Editor
186. Which class defines a whole set of math operations in Java?
(A) JMath (B) MathJ (C) Math (D) MathC
Ans. : Math
187. Function sqrt0 is one of the static method members of the following class.
(A) MathJ (B) Math (C) JMath (D) MathC
Ans. : Math
188. What is used if we want to control a loop to break and a loop to reiterate?
(A) Labelled loop (B) Hided loop (C) Highlighted loop (D) Advanced loop
Ans. : Labelled loop
189. Which of the following is a use of labelled loop?
(A) To control the exit of certain loop (B) To control the reiteration of certain
loop
(C) a and b both (D) None of these
Ans. : a and b both
190. How many byte Unicode character is character in Java?
(A) 2 (B) 3 (C) 4 (D) 5
Ans. : 2
----- EM STD 12 CH 7 -----

You might also like