Page 1 :
(a) min(), , Multiple Choice Questions, , () abs(), , 1. Among the following, which method does not, , (a), , A class, , An abstract method, , (a) Integers, , (d) None of the above, , 2. Which language was developed as the first purely, , (b) Floating-point numbers, , object programming language?, , 3., , (c), , (a) Java, , (b), , C++, , (c), , (d), , Kotlin, , Small talk, , the, , Among, , 13. The Math class is included in which java package, , specifier?, , 4., , Protected, , (c), , Pointer, , Among, , the, , (b) Private, (d) Public, , following,, , an, , OOP'S, , 5., , 15., , Abstraction, , (d) Java.sys, , (a) Java.util.", , (b) Java.Date., , (c), , (d) Java.lang.", , Java.io.*, , What does, , the, , object has?, , (a) Attributes, , (b) State, , (c)Behaviour, , (d) All, , Use of pointers, , find the odd, from Question 16-20, , (b), , Architecture Neutral, , 16. (a) Code Reusability, , (c), , Object-oriented, , minor, 6. Which is the, , /redundant, (c) Duplicate, , integer data type?, (d), , int, , which is not, , a, , (c) Byte, , (b), , Short, , (d), , Int, , (c) Message passing, , empty loop in, , (a), (b), (c), , java, ( a ) l t has, , (b), (c), , (d) Platform independent, 18., , satisfies the, 8. Which of the statement, , an, , empty, , clause, , an, , (c), , Among the following classes,, , superclass, , Inheritance, Structure, , and, , and Union, , Continue, , of all, , (d) break, , other classes is?, , (a), , Math, , (c) System, , (b) Process, , (d) Object, , 10. Which of the function is a rounding function of, , Math class?, , 20., , Destructor, , and Polymorphism, , b) for(), , (d) All of above, a, , Constructor, , (d) Class and Object, 19. (a) if0, , conditional clause, , empty increment, It has an empty initialization clause, , It has, , data, , (b) Data Binding, , primitive, , data type?, enum, , one, , (d) Modularity, 17. (a) Data hiding, , (b) Longg, , (c) short, Among the following,, (a), , of the above, , (b) Efficient code, , (a) Byte, , 9., , () Java.util, , (a), , (d) Dynamic, , 7., , Exception, , (d) Polymorphism, is not a Java feature?, Which among the following, (c), , (b) Java.lang, , isincluded?, , which is not, , (b), , Encapsulation, , (a) Java.io, , 14. Todisplay the date and time in java which package, , concept?, , (a), , Both Integers and floating - point numbers, , (d) None of the above, , which is not valid class, , following,, , (a), , (b), , (c), (d), 12. Modulus operator, %, can be applied to., , (b) An interface, , (c), , Which of these have, (a) 0, , 11., , have a body., , (b) max()0, (d) all of the, ntioned., the highest, precedence., , (a) Integer stream, (b) Short stream, , (c)Bytestream, (d) Long stream, , out:
Page 2 :
unctions, , AWHILE loop, est once, , even, , in Java executes the statements at, the condition is not satisfied, , OR, a, What is the outputof Logical, the inputs/operands is true, one of, (b) False, True, , (c), , (d) Loop, , Continue, , Window, , Tools, , All Writing Tools, Abstract Window Toolkit, , (c), , Abstract, , (d), , Writing Toolkit, , 37. Valid declaration, , (b) False, , of a char is, , (a) char ch "\utea';, (c) char cr \u0223;, -, , contains a Loop-Counter, A loop in Java generally, , =, , variable., , (b) False, , (a) True, , (b), , Dennis Ritchie, Andrea Ferro, , ()AdeleGoldberg (d), t.An OO1PS program, , contain, , can, , of, , (a) Only 999, , (b), , Only 100, , (c) Only 1, , (d) Any number, , 8. The object cannot be, , (a) passed by value, , (6) passed by copy, , (c) passed by function, to find and, , fix bugs, , 'tea';, , cc, , =, , '\itea';, , (c) 5, , (d) 4, , adds, , structure, , the function, , of, , encapsulation, (b), , False, , Which of the, 40. To find the square of a number,, following statement is false, , (a) Math.pow(a,2), , (b) Aa, , (c) Math.sqrt(a,2), , (d), , All of the above, , (a) Assembler language, (b) Byte code, , (b) JRE, (d) JDK, , (a) JDB, (c) JVM, , (c) Bit code, , (d) Machine code, , 30. Byte Data Type range is., (a) -128 to 128, , (b) -127 to 128, , (0) 128 to 127, , (d), , of, , integer, , -127 to 127, , Java, , in, , Programming, , S, (a) 8 Bytes, , (b), , 1 Bytes, , (c) 2 Bytes, , (d), , 4 Bytes, , 32. To access the instance, , class objects, , variables and methods of, , in java., , (a) dot operator(,), , (c)bitwise, operator decreases, , is used, , (b) instance of, (d) conditional, the value, , number, , (a)4, , (b), , 1, , (c) 2, , (d), , 3, , by_, , 34. Exit controlled, loop is_, (a), , =, , into, , 9. The Java program use, , S3,, , ca, , 41. Java compiler javac translates Java source code, , (d) passed by reference, , 31. Size, , char, , (b) 2, , (a) True, , classes., , char, , (a) 3, , 39. User-defined, no, , (b), (d), , types of polymorphism, , 38., , invented OOPS., (a) Alan Kay, , by, , (b) Switch, , (b), , return a value, , (a) True, , used, , (a) Break, , (a) All, , () operation if, , (a), , Constructor can, , is, , 36. AWT stand for, , (b) False, , True, , branches, , statement, , (b) F'alse, , (a) True, , (a), , 35. Multiple, , can't return objects., , for, , (c)Dowhile, , 42. In, , character constant's value is its, value in the,, character set., , Java,, , a, , (a) EBCDIC, , (b) Unicode, , (c) ASCII, , (d) Binaryy, , 43. An, , abstract data type, and a set of_, , integer, , typically comprisesa, respectively., , (a) Data representation, classes, , (b) Database, operations, (c) Data representation, objects, (d) Data representation, operations., , Programming Based Question, 44. What is the result of the expression float a = 35/0?, , (a) Infinity, (b) Run time exception, , (b) While, , (c), , (d) If lese, , (d) 0, , Not, , a, , number
Page 3 :
342, , IcSE CHAPTERWISE MCQs (Computer Applications) - X, , 45. Evaluate the following expression, if x=3, y=5, and, =10:, , 56. With, , javadoc,, , which of the, javadoc comment?, , following denotessa, , +z+y-y +z+xt, , (a) I/, , (b), , (a) 23, , (b) 25, , (c) /**, , (d) /*, , () 20, , (d) 24, , 57. How many times Hello' is printed?, , Public static void main(String args[)), , 46. The result of the expression of 818., (a) 64, , (b) 1, , (c)8, , (d) 16, , for(i = 0;i<5;i++), , 47. What will be the value of expressiorn a/b? If a =14, , and b 4, both a,b are type int, , System.out.println("hello");, , (a) 3, , (b), , 2, , 4, , (d), , 1, , (c), , break;, , 48. If a user wants to execute a loop 10 times, which of, , the following statement will be used, , (a), , 5, , (b) 4, , (a) for(i-6ic=26;i-i+2), , (c), , 1, , (d), , (b) for(i-3i=30;i-i+3), , 58. Public, , Class Yes, , (c) for(i-0i<10;i=i++), , (d), (a), , Public, , All of the above, , 49. Math., , Static void main(Stringl| args), , ceil(46.6) output is?, (b) 46.6, , 46.5, , 0, , for (int i=0; i< 10; i+), , (d) 47.0, , (c) 46.0, , Intx = 10;, , 50. Math.floor(46.6) output is?, , 51., , (a), , 46.0, , (c), , 47, , (b) -46.0, (d), , 46.5, , Output above prg, , expression, Give the value of the following, , (a) 10(10 times), (c), , 6-2+10%4+7, , (a), (c), , (b) 10, , 13, , (d), , 12, , (a)0, , () 2, , (b), , 1, , (d), , 3, , result of the, 53. What will be the, , expression, , (a), , 2, , (b)-2, , (c), , 4, , (d), , 54. Evaluate the, , give as, (b) 10, error, (d) Compile time, , 59. If(a=0), , 14, , result of the expression, 52. What will be the, whenj-10 and k-3, , J%k, , no output, , will, , Ifa-0), , System.out.println("1 ");, -14%-3, , System.out.println("2 ");, , 4, , following Java expression,, , Else, , if X=S,, , y=5, and z-10:, , System.out.println("3 ");, , +z+y-y+z+x++, (a) 24, , (b) 23, , Above will, , (c)20, , (d) 25, , (a), , 55. What is the type and value of the following, , expression? (Notice the integer division), , (c), , give output as, , 12, , (b) 13, , 3, , (d), , 23, , 60. Class full, , -4+1/2+2*-3+5.0, (a) int -5, , (c) int-4, , (b) double-4.5, (d) double -5.0, , Public static void main(String args[l)
Page 4 :
Revision of class IX Syllabus, , 343, , 65. The following program is based on the, specification given below. Fill in the blanks with, appropriate java statements., , Intx = 3.14;, , Inty (int) Math.floor(x), , class name: hello, , System.out.print(y);, , we have first initialized the two variables i and k, with the values 2 and 1 respectively., , What will, , be the, , (a) 0, , while loopis used with the condition ++i<6. Thus,, , output, (b) 3, , the value of will increase by 1 before it can be, used further because of a preceding ++ operator, , (d) 3.0, , )4, , What will be the value of x, , after executing the, , following statement, , xsy)?(y+>x), , :, , in the condition.then assignment operator will, be used between k and i. So the value of k will, become 3.this will continue till the value of k will, , (y-x);, , become 60., , If int x=15; y=20;, (a) 5, , (b) 15, , (c)25, , (d) 35, , class (a), , main(String, , publicstatic (b), , 82. Class A, , args[l), Public static void main(String [] args), , k=1;, , int i-(c), while (+ti<6), , Int x = 11 &9;, , (d)., , Inty=x^3;, , System.out.println(e)., , System.out.println(y | 12);, , Output of the above will be, , (a) i) hello, , (a) 14, , b) 0, , i) class, , () 7, , (d)8, , (iii) void, , 63. Class abc, , (b) ) class, (i) void, , Public static void, , main(String argsl), , (ii) object, , (c)i)i=1, , Int g 5;, , (i) i =2, , System.out.print(++g* 8;, , (ii) i -0, , (d) (i) k*=i, (i) i* = k;, , What will be the ouput, (a) 44, (c) 48, , (ii) k=i;, , () 56, , (e) () (k), , (d) 40, , i) ), (iil) (6), , 64. Given,, , intvalues]={1,2,3,4,5,6,7,8,9,10);, for(int i-0i<Y; +*i), System.out.printin(values[i);, , valuelil?, Find the value of, , (a) 10, (c)15, , (b) 11, , (d), , None of the above, , 66. The, , following, , based, specification givenprogram, below. Fill in the, is, , appropriate java statements, , class name: calculate, we, first, withhave, initialized the, the, values 50 and 5, , or, , on, , the, , blanks with, , two, , variables x andy, , vice versa..
Page 5 :
344| 1CSE CHAPTERWISE MCQs, (Computer Applications), Then the while, loop is executed, less then, equal to, , to, , check of, , y,then y is divided by, , The, , x, , X, , -, , is, , expressions, , x., , loop will execute 2 times. After 2, iterations, y becomes less than x so, condition of while, becomes false and it, loop, stops executing., class (a), , public, , static void, , evaluation, which, , is, , operands, , based on he, , based, , (a) if (c>d), x C;, , else, x, , args[), , for, , value of the first, , d;, , (?:), , main(b), , (i) x = (c >d)? d : d;, , (ii) x (c >d) ? c:c;, , int, , X=(c), , (ii) x - ( c d ) ? d:c;, , y-(d, , (iv) x (c >d) ? c:d;, , while(x=y), , (b) ?: ;are, , (i) Conditional operators', , y (e), , (i) Arithmetic operators, , System.out.println(y), , (ii) Bitwise operator, , iv) Assignment operator, (c) If else Statement, , i) One-way selection statement, , (a) (i) class, (i) calculate, , (ii) Two-way selection statement, (iii) Multi-way selection statement, , (ii) void, , (iv) Multipath decision statement., , (d) What is the other name for (?:)Question Mark, , (b) i) string, , Colon Operator.?, , (i) void, , (i) Comparison Operator, , (ii) calculate, , (i) If-Else Operator, , (c) )x=50, (i) x=5, (ii) x = 1, , (d) )y =50, (i) y-5, , (ii) y =1, (e) (i) y/x, (i) xly, (ii) y/y, , Case Study, 67. Read the given below and answer the questions, , 68., , (ii) Binary Operator, iv) Ternary Operator, Java offers a rich set of operators, , to, , manipulate, , variables. Operator in Java is a symbol that is, used to perform operations. For example: , ,, / etc. Operators are special symbols that execute, specific operations on one, two, or three operands, and then return a result. Operators with higher, precedence are evaluated before operators, , with relatively lower precedence. Operators, on the same line have equal precedence. When, seem in a similar, rule must govern, which is assessed, , operators of equal precedence, , expression,, , a, , given below:, , first. Entirely binary operators except for the, , Conditional operators are merely a condensed, , assignment operators, , are, , assessed from left, , to, , form of the if-else Statement which also returns, , right; assignment operators are evaluated right, , a value. Conditional Operators in Java are also, , to the left. *= is an assignment operator. It uses, , known as ternary operators. The term ternary, , an arithmetic operator like +, , *, or /, and the, , is used because this operator consists of three, , assignment operator (a single =")., , operands used to evaluate Boolean expressions., , (a) int k=1,i-2;, , The ultimate aim of the operator is to decide, which value is to be assigned to the variable., The Java Conditional Operator selects one of two, , while(++i<6), k=i;
Page 6 :
Revision of class IX Syllabus, the switch statement, , System.out.println(k);, , (a) int main(), , Predict the output, , (ii) 60, , (i) 30, , is equal, (b) k=i;, (i) k k i;, *, , =, , =, , while(true), , (iv) 50, , (ii) 20, , (ii) k, , 345, , k -i;, , to, System.out.println("RABBIT");, , (ii) k=k+i;, , break;, , (iv) k=k/i;, , return 0;, i) Increment operator, (ii) Decrement operator, , Predict the output, , (i) Arithmetic operator, , (i) RABBIT, , (iv) None of the above, , (ii), , are., d) Types of Integers, , (i) No output, , all of the above, , (iv), it is sometimes, . While working with loops,, needed to skip some statements inside the loop, the loop immediately without, or terminate, examining the test expression. In such cases,, , (i) long, , printed an unlimited number of, , times., , (i) int, , (i) short, , RABBIT is, , Break, statement in Java terminates the loop immediately,, break and continue statements, , are, , used., , (iv) Compiler error, , (b) Loops in are implemernted using., i) While Block, , (ii) For Block, , (ii) Do While Block(iv), , (c) What is the way to come out of or Quit an-, , Loop suddenly, , program's control transfers to the next, statement following the loop. It is almost used, , (i) quit; statement, , with decision-making statements (Java if...else, , (ii) break; statement, , and the, , Statement)., , It, , can, , be used to terminate, , a case, , All the above, , in, , Answers, , (ii) leave; Statement, (iv) continue; Statement
Page 7 :
Answers, 4. (b) Exception, , le Choice Questions, , 5., , An, astrat method, , planation:, , planation:, , Abstract, , method is declared, , using, , the Aevwoni abstract., are declaration only and are not, Ahstract methods, mpiemented. It does not have a method body., , Ahstrat m, , Small talk, , c, , programming language., , 6. (a) Byte, , Explanation: 'byte' is signed 8-bit, , programming language, as the first pure OOPS (objectwas invented, anented) language. This language was designed, Alan Kay in the early 1970s., , Fplanation:, , (a) Use of pointers, abstraction, Explanation: Java provides a layer of, in Java., to the developers by not using pointers, Java is dynamic, architecture and object-oriented, , Small talk, , data, , Explanation: An enum is a type that has fixed, list of possible values, which is specified when the, a, , enum is created., are, , three types of Access, , they are accessible outside the class, Private: they are not accessible outside the class, Protected: They can't be accessed outside of its, cdass unless with the help of friend class., , Public:, , integer, , that has range from -128 to 127., , 7. (a) enum, , Pointer, , Explanation: There, speatied, , type, , smallest, , 8., , (d) All of above, does, Explanation: An empty loop is a loop which, not have any updating or value of iteration., , 9. (d) Object, al, Explanation: The object class is a superclass of, , other classes.
Page 9 :
Revision of class IX, t, , Switch, , stion: Branching statements allow the, , Bplanation:, , heprogranm., oram. The, The, , that the value will first increment, by 1, i.e. 12., Now, evaluate the statement by, putting the values, of x, y, and z. On, evaluating the, we, , common branching statements, , within othe, ther, , control structures include:, continue, return, and goto., , Abstract Window Toolkit, , +zty-y+z+xt+, , nation: The Abstract Window Toolkit (AWT), , 11+5-5+ 11, , original platform-dependent windowing, his, and user-interface widget, p, , h, , i, , c, , toolkit,, , Explanation: Converts the value of both the, , ing., , operands into binary form and performs OR, , a)charch='lutea, , operation bit by bit., , tanation: A char literal may contain a Unicode, ter (UTF-16). We can directly use these, , 47. (a) 3, , Explanation: The value of a/b would be 3.5,. Give, , s h a r a c t e r, , file system allows us, else, Laracters only, aUnicode escape (\u) such as "\u02tee"., it, , our, , result in Integer data type when both the operands, , c h a r a c t, , are in integer data type., So, the result would be 3., , )2, , lanation: There are twotypes of polymorphismm, , 48. (b) for(i=3;i<=30;i-i+3), , iplar, , n java:, , Static Polymorphism, , also known, , as, , Explanation:, , compile, , (i, , =, , 3; i, , <, , =, , 30; i, , i, , =, , +, , 3)Will, , 3,6,9,12,15,18,21,24,27,30}, , Dynamic Polymorphism also known, , as, , 49. (d) 47.0, , runtime polymorphism, , Explanation: The Math.ceil), , ), , rounds a number up to the next largest integer., , False, The, , Explanation:, , encapsulation concept does, , always, , The Math.floor() function returns, the largest integer less than or equal to a given, , Explanation:, , number., , t, , 51. (a) 13, , lc) Math.sqrt(a,2), , Explanation: Math.sqrt, , would, , return, , Explanation:, , the square, , translates, set of programs which, , program, , e, , Source code into java byte code, , java, , character in, , Every, unique value that is called Unicode., , JAVA has, , a, , we, , (6) -2, Explanation: % is, , a, , Remainder, , operator., , the above, , expression,, , increment, that the value will first, , it, , ++z means, , by 1,, , ie., , 12, , by putting the values, Now, evaluate the, the expression, we, of x, y, and z. On evaluating, statement, , divide any number, , a0uble, float, and long except integer) by zero,, Tesults in infinity., , 53., , Explanation: In, , isamming Based Question, Whenever, , 52. (b) 1, , 54. (d) 25, , 1d) Data representation, operations., , on ) Infinity, he planation:, , = 13, , Explanation: % is a Remainder operator., , 6) Unicode, Explanation:, , first.as, , = 4+2+7, , Java Compiler javac is a computer, , K, , or, , operation, , -6-2+247, , Byte code, Explanation: A, , Perform modulus, , it has got a higher priority., , oot of the number instead of the square, , ), , function, , 50. (a) 46.0, , in a user-defined structure, not add the function, functions are involved,, because if the member, structures defined by, then the user cannot call the, , is, , for, , generate numbers in the set:, , ime polymorphism, , a, , +3 -25, , 46. (c) 8, , o, , prRPding, , expression,, , get 25, as shown below., , Abstract, , a, , 347, , Explanation: In the above expression, t+z means, , fexecution to jump to a different part of, , r, , Syllabus|, , 45. (b) 25, , get 25,, , as, , shown below., , + z t y - y +z + x++
Page 10 :
348, , IcSE CHAPTERWIsE MCQs (Computer Applications) - X, , 11 +5-5 113 -25, Hence, the correct answer is option (d)., 55. (d) double -5.0, , 62. (a) 14, , Explanation:, , The &, , when both bits, , are, , operator produces, , Explanation: The execution goes on like this:, , is 9. The, , 4 1/2+2*-3+5.0:, , one bit is 1; the result of, , 4+ 0+ 6, , 5.0; // integer division: 1/2 truncates, , 5, , -105.0: / higher type is double 5.0, so -10 is, casted to double, 5.0:, , 1/, , finaly,, , double -5.0., , 56. (c), Explanation: In JAVA/*is used to write comments, within the program, 57. (c) 1, , Explanation: It is printed one time only because, break; will terminate the current loop, 58. (d) Compile time error, , Explanation: Curly braces are optional and, without curly braces we can take only one, statement under for loop which should not be, , declarative statement. Here we are declaring a, variable thae's why we will get compile time error, saying error: variable declaration not allowed, , 59. (c) 3, Explanation: Since the first if condition is not, , met, control would not go inside if statement and, hence only statement after the entire if block will, be executed., 60. (b) 3, , peration, , this operation exactly, is, 1 bit when at, lea, , The I operator produces a, bit is 1; the result of this operation is 14, 63. (c) 48, , than, , ,thus g becomes 6 and, , when, , gives 48, , eference, , multiplied kby 3, , 64. (d) None of the above, , Explanation: In the above code, we have, hot, defined the variable Y. The code will not, , without any, , exception, as, Exception, , execut, value for Y, it, results in, shown below., , specific, , in, , thread, , "main", , Unresolved compilation problem:, , java.lang.Erro, , Y cannot be resolved to a variable, So, the values of i will not be printed, and the, , above exception is thrown., Hence, the correct answer is (d)., 65. (a) (i) hello, , (c), , (i) i = 2, , (d) i)k*=i, (e) () (k), 66. (a) (ii) calculate, , (b) i) string, (c) (i) x =5, , Explanation: double floor(double X) returns, , (d) (i) y =50, , (e) (i) y/x, , variable X., , iere the smallest whole number less than 3.14 is Case Study, 67. (a) (iv) x =(¢>d)? c: d;, , Output:, , (c) (i) Two-way selection statement, , Sjava Output, , (d) (iv) Ternary Operator, , 61. (d) 35, , Explanation: x 15, y =20;, x- (x<y)?(y+x):(y-x);, , I/since x <y, (y+x) will be executed, so, , (b) (i) Conditional operators', , S javac Output.java, , 3, , the answer is 35, , t one, , Explanation: Operator +* has more prefer, , a largest whole number less than or equal to, , 3., , 1, , operator produces a 1bit when, , (b) (i) void, , here., , a, , 1. The result of the, & oas, , 68. (a) (i) 60, , (b) (i) k=k* i;, , (c) (i) Increment operator, (d) (iv) all of the above, 69. (a) (iv) Compiler error, , (b) (iv) All the above, , (c) (ii) break; statement