Page 1 :
SAMPLE BOOK FOR PRACTICE, COMPUTER SCIENCE, FIRST SEMESTER 2021-22
Page 3 :
BIFURCATED SYLLABUS, (As per the Reduced, Syllabus for ISC, , Class XIl Year, , (SEMESTER 1), , 2., , 3., , ., , 5., , o., , NAME OF THE UNIT, , 8., , NAME OF THE, , SUB-UNIT, , Boolean Algebra, , (Complete Unit), Computer Hardware, , (Complete Unit), Implementation of algorithms to solve problems, , (Complete Unit), , Programming in Java, (Complete Unit), , (Review, , of Class XI Sections B and, C), , Objects, (Complete Unit), Primitive Values,, Wrapper classes, Types, , (Complete Unit), , 7., , Examirination, Max Matts, , UNIT NO., 1., , 2022, 2022, , and, , casting, , Variables, Expressions, , Complete Unit), Statements, Scope, , (Complete Unit), 9., , 10., , Methods, , (Complete Unit), Arrays, Strings, Arrays
Page 4 :
SYLLABUS, COMPUTER SCIENCE, , PAPERI-THEORY, SECTION A, Boolean A l g e b r a, , itional logic, well formed formulae, truth values and interpretation of well formed formulae (wf), truth tablE, , a h l e , unsatisfiable and valid formulae. Equivalence laws and their use in simplifying wffs., ables; the common logical connectives (- (not)(negation), A (and)(conjunction), v (or)(disjunction),, , ropositional variabl, , (biconditional); definition, , e, , nplication),, , (implh, , olems as, , problen, , tishable,, , for, , can be used, , wff (this, , of, , well-formed formula, , a, , (wf); 'representation, , the values true and false; interpretation of, , motivation);, , a, , of simple, , wff;, , truth, , wora, , table5, , and valid formulae., , unsatisfia, , laws; law of implication, associativity of A, V; distributivity; De Morgan's, law o, law of negation (- (-P) =p);, law of biconditional (p>)= (7 q)a (q>p); identity (p=p);, rules, (oqE-pVq);, and contingency simplification, V, p= true); law of contradiction (pn ~p =false); tautology, middle, (p, Pxcluded, , Fauivalence, , laws: commutativity of ,, , V;, , ~, , for A,, , positive., , inverse and contra, V. Converse,, , Binary, , valued quantities;, , algebra; operations AND, OR, , postulates of Boolean, , basic, , and NOT; truth tables., , distributivity, operations, , idempotence, commutativity, associativity,, theorems of Boolean algebra (e-g. duality,, c Basic, theorem and its applications; reducing, involution); De Morgan's, absorption,, complemernts,, and, 1,, 0, with, to four variables)., and product of sums forms; Karnaugh maps (up, sum of, , expressions to, Verify the laws, , products, , algebra using, , of Boolean, , truth tables., Maxterms, , POS representation;, ircuit etc., SOP and, and Boolean algebra., using Karnaugh maps, , Inputs, outputs, , full adders,, for circuits like half and, , and Cardinal representation,, & Minterms, Canonical, , 2 Computer Hardware, , Elementary logic, , b) Applications of Boolean algebra, NOR as universal gates., Show, , majority, , reduction, , in circuits., , XNOR) and their, OR, NAND, NOR, XOR,, NAND,, gates (NOT, AND,, decoders, multiplexers,, full adders, encoders,, use, , a), , Boolean, , the correspondence, , NAND and NOR, , gates, , and, , logic gates to, , half adders,, , circuits, corresponding switching, NAND or NOR gates., circuits to purely, , or, , methods and the, between Boolean, , are, , universal, , some, , by converting, , gates., , Show that, , SECTION-B, , to solve problems, , with the lectures. Programmingg, lab concurrently, in the computer, Assignment problems, do lab assignments, least one assignment., covered in t, Ine students are required to, topic is, each, major, that, design, address c o r r e c t n e sSSs, done such, Students must do algorithm, 5signments should be, challenging., are sufficiently, where necessary., be designed s o that they, and debug, algorithm in Java, execute the, ues, implement and, , mplementation, , of algorithms, , Ould, , Self explanatory., , (Review of, TOgramming in Java, Note that items4, , to 13, , While reviewing,, r, , ensure, , 5.Objects, a) Obje, , Sas, , of some, , +, , real-world, , e,, , extracting, , introduced, , higher, , behaviour, , order problems, , (methods);, , object, , examples, am, , tokens, , from, , an, , IDK;, , input, , Sections, , almost simultaneously, , programming, , sic input/output using, , whitesp, , be, , new, , that, , data (attributes), , D) Analysis of some rea, R, , should, , Class Xl, , in, , are solved, , along, using, , instance, as a n, , terms, , input/output, , stream, , B and, , (String, , C), , with classes and their definitions., these, , constructs., , of a class., , Constructorc, , rs., , of objects and classes,, , exceptions., , Tokenizer, , 1Okens, , class)., , n, , an, , input stream,, , concept of
Page 5 :
6., , Primitive values, Wrapper classes, Types and casting, boolean,, e, , «, values and types: byte, int, short, long, float, double, boolean, char., Correspondine, , primitivetype., , Class as lype of the object. Class as mechanism for user delined, Casting and automatic tvpe coercion for some primitive tyPes., , wrappertypes,cla, nging, , types. ChaneinP, , 7. Variables, Expressions, , Variables as names for valus, lues; naned constants (final), expressions (arithmetic and logical) a, PetatorS, associativity, precedence). Assignment operation; difterence between left hand side., , of assignment., , 8. Statements, Scope, tatements; conditional (if,, , if else, if else, , if, switch, , case,, , ternary operator), looping (for,, , oreakgrouping statements in blocks, scope and visibility of variables., , while,, , da, , ., , 9. Methods, Methods (as abstractions for, complex user defined operations on objects),, methods; Static method and variables., The this, , Examples, problems, finding roots of algebraic Operator., equations etc.)., 10. Arrays, Strings, number, , Structured data, types arrays, , of, , formal, , arguments, , and, , achua, , algorithmic problem solving s-, , (single, multi-dimensional), address calculations, strings., structured data types, (e.g. searching, finding, Example alg, maximum/minimum, sorting techniques, solving, equations, substring, concatenation,, svse, length, access to char in string, etc.)., Storing many data elements of the same, type requires structured, time and does not, depend on the number of elements. Address data types like arrays. Access in a, calculation (row major and column :, techniques (bubble, selection, insertion)., Structured data types can be, library String class and the basic, defined by classes, on, String, strings (accessing individual, concatenation, replacement, indexoperations, of, characters, various subsing, operations)., use, , and, , -, , -
Page 6 :
COMPUTER SCIENCE, Specimen Question Paper, Maximum Marks: 80, Time allowed: One and a half hours, , (Candidates are allorved additional 15 ninutesfor only reading the payer.), ALL QUESTIONS ARE COMPULSORY, , The marks intended for questions are given in brackets [ 1., , Each question/subpart ofa questioncarries 1mark., resents the Boolean, , whic, , law, The, (a) Associative Law, , equation A, , (c) Commutative Law, , Thedual of the, (a) X+Y+0, (XY)+ 1, , (c), , fA=1, B-0,, , Boolean, , equation (X+Y) -1, , then the, , maxterm, , (b), , Distributive Law, , (d), , Absorption Law, , b), , XY +0, , (d), , (X+Y), , (b), (d), , A+B°+C+D, , the, , of, Thecompliment, , Boolean, , [1, , =X*Y, , +0, , =, , XY, , will be:, , (a) AB'C'D, (), , [1], , =B+ Ais:, , X+Y is:, , =, , =XY, , C=0 and D=1,, , +B, , expression F(PQR), , =, , A'BCD, A'+B+C+DD, , R), , (P+Q+, , 1, , is:, , (b) P+Q +R, , (a) PQ'R, , +, , R", , (d), , (P+Q), , (b), , Implication, , (d), , Negation, , (b), , Converting, , () P+(Q+R), , Thepropositional, , operator, , =>, , represents:, , (a) Conjunction, , () Disjunction, 6Encoders are used for:, , (a) Adding two bits, C) Converting Binary, , to, , to Decimal, , the, , circuit, , 1, , combinations, , which, , ot:, , (b), (d), adds t w o, , binary, , OR gate, AND, , and NOT, , gate and, , gate, , NOT, , gate, , (b), , Decoder, , (d), , Multiplexer, , [1], , e l i m i n a t e s :, , Four variables, , The Quad group in, , map, , b), (d), , Karnaugh's, , a, , Two variables, , a) One variable, , [1], , ) Three Variables, , The proposition (a, , <=>b) is, , represented, , by:, , (b), , (a+b) (a+b), , (d) (ab), , a) a'b' +ab, , ent output will be:, , equivalent, , )(a+by, , decimal, , f the input in a o, la)8, , decoder, , )5, , [1], , bits is:, , la) Full Adder, , Half Adder, , Binary, , Data transmission, , by, NDgate is, )AND gate and OR gate, ) NAND gate and NOT gate, ombinational, , Decimal, , (d), , formed, , The, , [1, , then, , is A, , 'BC'D,, , the, , (b), , (d), , 10, 6, , [21
Page 7 :
266, , sC CHAPTERWISE MCQs (Computer Science)- XI, , 12. A matrix MAT|1O|5| is stored in the memory in Row Major Wise, , with each e, , stOrage. If the base address at MATIU||2| is 2215, then the address of MAT|3]|71, , (a) 2285, , (b), , ), , (d) None of the above, , 2319, , 13. With, , 2315, , Jement, reou, ill tbeeruti, , reference to the given proposition-P->Q, answer the bllowing questions, , (a) the converse of the, proposition 1s:, , ), , Q->-P, , (i)-Q=>P, , ii)-Q=> -P, contra-positive of the proposition 1s:, , (iv)-P>Q, , (6) the, , -P->Q, , () Q->P, (iv) Q>-P, , (Gii)-Q->P, 14., , Ihe, , reduced expression for the Boolean, expression F(X,, (a) XY +XY, (b) 1, ) 0, , Y,2)=2(0,1,2,3,4,5,6,7) is:, , (d) None of the above, , 15. What is the, int ij;, , output of the code given below?, , for( i=1; i-5i+);, , for(j-i+1js1jtt};, , System.out.printi +"+*" +j);, , (a) 67, () 6+7, 16. What is the, , (b) 1+2, , output of the statement given below?, , (d), , 12, , Syst, m.out.print(Integer.parselnt("234")*A);, (a) e234+65, , (b) 234A, (d) ERROR, , (c) 299, 17., , What is the output of the, statement, , System.out.print(A', +1'+C);, a) 65+1+66, , given below?, (b) 10+1+67, (d) 65+49+67, , (c)181, 18. The basic, , logic gate that represents the, , (a) OR gate, (c) AND gate, 19. What is the, conditional, of 'M' number of, index is, , rows, , simplification of the Boolean expression A.(A+5)., , statement to check for the, , and 'N' number of, , represented by 'c'., , proposition -(a Ab)V, (a) Contradiction, , (-a=>b) is a:, , Reduce the given Boolean function, F{A,B,CD), answer the following, questions:, , and, (a), , What will be the least number, , (i), , 6 pairs, , (ii) 1 quad and 3 pairs, , (b) The, , reduced expression of, , (i), , ACD+B'D' + BD, , (ii), , C'D', , +AC +B'D', , the, , of, , row, , index, , is, , a, , AT0, , imens", , double a, , represented oy, , (6) (r>0 &&t r<M-1 |l c0 && c<N-1), (d) (r>0 I| r<M-1 || o0 Il <N-1), , cN-1), , (b) Contingency, (d) Implication, , (c)Tautology, 21., , Non-boundary elements in, , columns? The, , (a) (r01 r<M-1 &&, c0 ll c<N-1), (c) (r0 && r<M-1 && c0 &&, 20. The, , b) NOT gate, (d) None of the above, , =, , 2(0,2,4,8,9,10,12.13) by using 4-variable, , groups and their types, formed for reduction, (ii) 2 quad and 2, pairs, (iv) 3 quads, Boolean function, given above is:, (i) (A+C+D').,(B+D)(A+C), (iv) (C+D). (B'+D').(A+B+D), , and tik
Page 8 :
SpecimenQuestion Paper|, ntends to select, ct candidates for an Inter school competitio as per the criteria given below:, , 267, , inten, s, , 2, , c, , h, , o, , o, , l, , Aent has participated in an earlier competition and is very creative, , A, , The s t u, , Or, udent, student, , is, very c, creative, reative and, is, , very, , has excellent general awareness,, , but, , has not, , participatea, , n, , any, , The, competition earlier, , Or, , chudent has excellent general awareness and has won prize in an inter -house competion, The s, Theinputs a r e :, , Inputs, , Participated in a competition earlier, , A, , Is very creative, , B, , Won prize in an inter house competition, , C, , Has excellent general awareness, , D, , (In, X[, , 1, , indicates, , all the above, , cases, , yes and 0 indicates, , no, , 1 indicates yes and 0 indicates no)., , for all cases]., , questions:, above and a n s w e r the following, table for the inputs and outputs given, truth, Draw the, will be:, expression for X(A,B,C,D), 12, 13, 14, 15), a)The POS, F(A,B,C.D) «[3, 5, 7, 11,, (i), 14,, 13,, 15), 12,, 11,, 7,, 5,, (3,, 6, 8, 9, 10), ) F(A,B,C.D), F(A,B,CD) 2(0, 1, 2, 4,, (iv), 9,, 8,, 10), 6,, 4,, 2,, 1,, T(0,, (i) F(A,B,cD), table will be:, , Qutput:, , [2, , =, , =, , =, , =, , The maximum, , (b), , input, , combinations, , for the above truth, , (ii), , 24, , (iv), , (ii) 8, 3Reduce, , the, , given, , F(A,B,C,D), Boolean function, , =, , 16, 4, , r(3,4,5, 6, 7, 11,13,15), , by using, , 4-variable, , Karnaugh map, , [1, , reduction?, the following questions:, formed for, and their types, of, groups, number, the least, (ii) 3 quads, (a) What will be, and 3 pairs, (i) 6 pairs, 2, , and, , answer, , ii) 1 quad, , (), , and 3, , pairs, , of the, The reduced expression, , (6), , (B-C).(B+D).(A*+D), , (i), , AB', , quad, (iv), above is:, function given, Boolearn, (ii), (iv), , 21, , BC+ BD +A'D, (A+B').(C"+D°),(B+D'), , + C'D' +B'D', , (1), F(A.B.C), C, , TOm, , the logic diagram given, , above,, , and C, where A,B, , are, , inputs and, , F is the output,, , answer, , the following, , questions:, a) The expression at, , 6), , (1) 1s:, , (ii) A'+B, (iv), , A.B, , A+B, , (ii) A + B, , 0, , The expression at, , ), , (3), , 1s:, , A+B.C, , (ii), , (iv), , ((A+B).Cy, , (A+B).C, , [1, , (i) (A+B).Cy, F(A,B,C) 1s, he final expression, , F(A+By.Cy +(A+, (01) F=( (A+B).C)Y + (A+B), , [1, , (ii), , F=(A+B).(C+A+B), , (iv), , F-(AB +C) +{A+B)
Page 9 :
268 ISC CHAPTERWISE, , Mcas Computer Science)- XII, 4 ven the Boolean expression F (P+R) (PQ+QR ), 1aentuy, (a) The, complement of the expression:, () P'R (P+Q)MQ+R), =, , ()(+R').(P+0)+(Q+R°), , ii) P'R'.(PQ +QR), , (iv) (P+R(P+Q)Q+R), , (b) The law used:, ), , Distributive Law, , (ii) Associative Law, In, , reference, void funçint n), , to, , the program code, given, , below,, , (i), , De Morgan Law, , (iv), , ldempotent Law, , answer the, , questions that follow:, , int i,f,;, for( i=1,f=1;i=ni+,f*=i);, , System.out.print(f);, (a) What is the, output of the method fun() when the value, of n=4?, ), 24, Gi) 72, (ii) 120, (iv) ERROR, (b) What is the method, fun), ) Checking for Prime, Numbers, , performing?, , ii) Factors of a number, 27. With, reference to the, program code, int test(int n), , if(n=1) return 0;, , (ii) Product of odd numbers, (iv) Finding the factorial, given below, answer the, questions that follow:, , for (int i-2;i-int)(Math.sqrt(n)jit+), , if( noi=0), return 0;, return 1;, , (a) What will the, method test) return, when the value of, 1, ), n=-9?, , (ii) 0, (b) What is, ), , the, , Prime, , method test0, , performing?, , number/Composite, number, Palindrome, number, , (ii), , 28. With, reference to the, void dimen(int, , int p-0;, , n[ }[ ]), , i) true, iv) Error, (i) Armstrong number, , program code given below, (iv) Perfect number, answer the, , questions that follow:, , for (int i-0;icn.lengthi++), , for(int j-0;jn[0]length:j++), , if(i-01li=n.length-1, P-ptnllbl, , Il, , j=0, , ||, , j-n{0]length-1), , System.out.print(p);, (a) What will be the output of the method, dimen(0 when the value, i) 42, (ii) 5, , (i) 33, (iv) 37, , of, , n[, , ]U=|(2.3,7111, , (1,5,9J,/10.-3
Page 10 :
Specimen Question, , method, , the, , 269, , Paper, , dimen() perform, , product of the boundary elements, , is, , F i n d i n gt h ep r o d u, , W h a t, , i t ) F i n d i n gt h e, , the, , sum, , F i n d i n g, , i), , the, , sum, , of the non-boundary elements, o ft h e boundary elements, , of the matrix elements, , ding, , code, , othe, , t h e ,program, (iv), reterence t o, , given below,, , answer, , the questions that follow:, , i tih, 1, d, singlefunt, M), , int, u=l:, , q i n ty = 0 y x . l e n g t h : y + ), , ily]%2-0 && xly>0), w-wy, , System.out.printfw);, , What, , 0, , of the, will be the output, , method, , single) when the, , 120, , (i) 720, , method, , 45, , (iv), , 18, , single() performing?, , What is the, elements, positive odd, Sum ofthe, elements, Product of, , (i), , the positive, , to the program, Nih reference, , i), (iv), , even, , code, , of x[], , =, , {10,2,9,-6,5,61?, , (21, , 1, , Product of the, , even, , elements, even, , elements, , Sum of the positive, that follow:, , answer, , given below,, , value, , the questions, , tsolve(int a, int b), , intil=0;, for(i=1ic=a*bit+), , iHfPoa-08&t i%b=0), , H;break;}, , [21, , return l;, , Wnat, , the, will be the output of, , method solve), , 4, , when the value, (i), , 96, , iv), , 24, , of a-8 and, , b=12?, , 0, , What isthemethod solve() performing, ) HCF of'a' and 'b', lüi) LCM of 'a' and 'b', , (ii), (iv), , Prime Factors, , None, , integer N, , of the above, , ean Palindrome(int N), , t rey=?12;, t num- N,, ATüle (num>0), , t=num/10;, , int s=222, htdigit= num, Tey 242+ digit,, -, , 23?, , the, , number, , is a palindrome, which, ?47 and ?5?, , the positive, e follo, code checks if, ?2?, ?37,, marked as ?1?,, T 8program, code, the, in, Some places, properly., are, code works, , expression so that, , of'a' and b', , by returning, , are, , to, , true or, , be replaced by, , a
Page 11 :
(Computer Science), , IsC CHAPTERWISE MCQs, , 2/0|, , num /= ?5?;, , it(rev, , N), , return true;, , else, return false;, , Answer the following question:, (a) What is the statement, , or, , at ?1?, , expression, , i)-1, (ii) 10, , (i), , 0, , (iv), , 2, , (ii), , f/10, , iv), , f*10, , (6) What is the statement or expression at ?2/, , i), , s *10, , (iii) rev, , () What is the statement or expression at ?3?, , ), (ii), , (ii), , s, , rev, , (iv) digit *10, , f, , (d) What is the statement or expression at ?4?, , i)s*10, , (ii), iv), , (ii) f, , (e) What is the statement or, expression, i)1, , rev *10, rev, , at ?5?, , (i), , (ii) 10, , 100, , (iv) rev, following program code sorts a single dimensional, technique. There are some places in the code marked as array, , 32. The, , by, , in, , statement/expression that the code works properly., void insertionSort(int arrayl), a, , so, , int n ?1?;, for, , (int j= 1:j <n;j++), int, , key ?2?;, =, , int i =j-1;, , while ( (i> -1) && (, array [i]>, , ?3?)), , array li+1] = ?4?;, , i25? key, , Answer the, , (a) What, , following question:, , is the statement, , i)array.length(), , or, , expression at, , ?1?, , (ii) length, (b) What is the statement or expression at ?2?, , ), , i, , (ii) arrayil, , ascending, , order, , using Insert, , ?1?, ?2?, 23?, ?4? and ?5? which, , (ii) array.length, (iv) -1, (ii), (iv), , arraylj+1], 0, , are to, , be, , a
Page 12 :
Specimen Question, , r ee x p r e s s i o n :, s t a t e m e n t or, , hestatement, , ?3?, , thhe, , is, , (ii) arraylil, (iv) n, , what, , Wha, , Key, , at ?4?, statement orexpression, , she, What, is, ti, , (, , i, , ), , a, , r, , r, , a, , y, , (i) key, (iv) arrayli|, , i, , 7, , the statement, s, , t, , a, , t, , e, , m, , e, , n, , t, , or, , expression at ?5?, , io t h e, , Hhat, i, , is, a, , r, , a, , y, , l, , Paper| 271, , i, , +, , 1, , (i), , i+1, , ], , (iv) array[li], , Answers, c) Commutative Law, , law, (A+B) (B+A), =, , Erlanation:, XY+0=XY, , According to, , Commutative, , found, , expression can be, each zero(0) with one(1), Also replacing, , the dual form of a, to the principle of Duality,, , Erolanation: According, each OR, each AND (°) to OR(+),, , byreplacingwith, and one(1), , (+) with AND (")., , Boolean, , (0)., , zero, , d 4+B+C+D, the, Explanation: As per, , Maxterm,, , 1, , means, , variable, , form, in the complement, , and 0, , means, , variable, , in, , the normal form., , law. In short,, , POR, t, d, , Explanation:, , Here, , replace AND (°), , to, , w e can, , replace OR(+), , to AND, , (°), , and, , form and complement, the DeMorgan's, to the complement, normal variable, the, Also convert, , we c a n u s e, , OR(+)., , form to normal., , b)Implication, Explanation:'', , ) Converting, , Decimal to, , planation:, , the implication, , represents, , Encoders, , about the decimal to, , Binary, can, , be used to, , decimal to, , binary, , ( In, , the syllabus, , binary encoder)., , AND gate and NOT gate, planation: NAND, , convert, , format, , means, , negation, , HlfAdder, Panation: Half adders, , are, , of AND,, , used for adding, , the, so it is, , two, , combination, , of NOT gate, , full adders, , whereas, binary bits, , and AND, , used for, , Dinary bits., , Iwo variables, O n : Quad, One, one variable., , eliminates, , two, , 1on:, , octet, , three variables, , If you form the, , SOP (sum, , of products), , which, to 0101, , of the equivalent, , and, , gate., , adding three, , pair r e m o v e s, , formula, , Nis the, , w e use, , number, , here, , row, , of columns=, , connective,, , then it is a'.b'+ a.b, , is equal to 5., , xplanation:n:A'.B.C".D, A'.B.C. is equal, 28, major, is, Explarmnation: The t, *N+0-LC), Address of MAT[IJU], MATII =B+ W* (1-LR), ROf, ,LC=2, , eliminates, , discuss, , group, , +ab, , Explanati, , variables,, , we, , 15., , wise., , From, , the question, B =2215,, , W=2,I=3,, , J =7,
Page 13 :
2I2, , isc, , CHAPTERWISE, , MCQs, , (Computer Science) - Xl, , Calculation, -2215+2x(15x(3-1) +(7-2)), , 13., , =, , 2215 +2x35, , =, , 2215, 2285, , (a) i), , +, , 70, , Q->-P, , Explanation: The given proposition is -PQ so converse, (b) (ii) -Q=>P, , Explanation: The contrapositive of the, , 14. (b) 1, , 15. (c) 6 +7, , given, , expression,, eliminating 3 elements. So 1 is the answer as it is the, SOP., , Explanation: The value of i is 6 and j loop will execute, , Explanation: Integer.parselnt("234")+ 'A', , 17. (c) 181, , Explanation: ASCII value of 'A', ASCII values, , (c) AND gate, , is 65+ 49+, , Explanation:, , =, , 67=181., , =, , 234, , +, , 65, , we, , get, , an, , octet, redu, , aucing, , only where j= i+1 (7)., , 16. (c) 299, , 18., , Q-P, , proposition is -Q>P., , Explanation: If we draw the Karnaugh Map of the, , means, , is, , (ASCII value of A), , 65 ASCII value of, '1-49 ASCII, , =, , 299., , value of 'C', , =, , 67. So sum, oi, , A.(A+B).(A+B) (A.A' A.B ).(A+B), (0+ A.B).(A+ B), =, , +, , =, , 19., , (b) (r>0, , && r<M-1 || c0, &&, , =, , A.B.A + A.B.B A. B, =, , c<N-1), , Explanation: To access the, , 20. (c), , condition for columns is c>0 non boundary elements the, &c <N-1., condition for, Tautology, , rows is r> 0 &, , rKMlE, , Explanation: The expression is:, , -(anb) V (-a =>b), , a^b, , 0, , (a^b), , a->b, , 0, , aAb) V(-a=>b, , 0, , 21., , So,-(a Ab) V (-a=>b), (a) (iv) 3 quads, (b) (ii), , 0, , will, , give always, , 0, , True, which means it is a, , C.D'+A.C +B'.D', Explanation: F (A, B, C, D) ss(0, 2, 4, 8, 9,, 10, 12, 13), ABCD CD, CD, , tautology., , =, , CD, , A.B, , C.D, , A-B, AB, , 12, , 13, , A-B, 9, , 15, , 11, , 10
Page 14 :
Specimen, , Quad 1 (0, 4, 12, 8) - C-D, Quad 2 (8,9, 12, 13) - A-C, Quad 3 (0, 2, 8, 10) = B-D, , ABCD)=(0,, , ( i i )F{A,B.CA, , anation:, , 1, 2, 4, 6,8,9, 10), , The PO,, , ö), (i) 16, , planation: as the, ere are, , 4, , expression for X( A,B,C,D)., inputs, there will be 24 (16) input, , combinations., , X(output), , D, , B, 0, , 0, , 0, , 0, , 0, , 1, , 0, 0, , 0, , 0, 0, , 0, 0, 0, , 0, , 1, X{A.B,C,D) = r(0,1,2,4,6,8,9,10), , la)(i) 3 quads, b, , (Giv), , (A+B').(C°+D°).(B'+D'), , Explanation:, , A+BC+ C+DP, , C+D, , C+D, , C+D, , A+B, , A+B, , 14, , A+B, , 12, , 10, , A+B, There will, , (4, 5,7, 6), (5, 7, 13, 15), , Quad 2, , lay (iv) A+B, , it) ((A+B).cY, F-((A+B).0, , + (A+B), , quads, , (3, 7,5, 11), , Quad 1, , Quad 3, , be 3, , Question, , Paper| 273
Page 15 :
274 |, 25., , ISc, , (a) (), , CHAPTERwISE, , MCQs, , (Computer Science) A, , P'R +(P"+Q)(Q+R), Explanation: Applying the DeMorgan's law, F-(P+R) (PQ+QR), (P+R). (PQ+Q.R)Y, (+R) (P.Q+Q.R"Y), (De-morgan's law), +, , P.R (P.Qy.(Q.RY, - P'.R +(P+O%Q+R), =, , +, , (b) (ii) De, 26., , (a) (ii) 120, , Morgan Law, , Explanation: n 4, f =i. The final value ofi is 5 and f=24, (4 factorial). The valtio, updated as f=24 *5- 120., ., off, (b) (iv) Finding the, factorial, (a) (ii) 0, Explanation: When n=9, the iterative values of 'i', are, 2 and 3, so it returns 0, (b)) Prime, number/Composite number, =, , 27., , Explanation: as it will return 1 for, , 28., , (a) (iv) 37, , prime number and 0 for composite, , number., , Explanation: 37 it is, (b) ii) Finding the sum the sum of the boundary elements of the 2, of the, dimensional array., (a) (i), , 29., , boundary elements, , 120, , Explanation:, The method, single() checks two, of, even, , conditions inside the for, number and other is, loop. Onme is, the condition of, checking, value of w=1, as the loop, greater than zero or not. The the can, , The initial, , b) (i) Product of the, positive even, 30., , (a) (iv), , Explanation:, 24, , It, , executes, it becomes 10,20, (10 2)and finally answeris, elements, 120/20:6, x, , calculates the product of the, positive even, , Explanation: 24. Here, condition i%a=0, , 31., , a= 8 and, b= 12. So the for, and i%b==0, only when, , (b) (iii) LCM of 'a' and, 'b, Explanation:, method, solve(), (a), (i) 0, , Explanation:, , (b) (iv) f*10, (c) (i), , i.e int, , rev=0, , Explanation: So, int, , Explanation:, , so, , Explanation:, , so rev=, , Explanation:, , so, , (e) (ii) 10, , int, , 32., , (a) (ii), , calculates the LCM of a, , (here we initialise the, , digit=numrev*10, , num/=, , num becomes zero.), , +, , Explanation: int key, , (8 12). It satisie, x, , and b., , value, , of, , rev), , num/10,, , for, , eliminating the last digit from num and eveni, e, , =, , array lj], , Explanation: array[il> key, , (d) (iv) arrayli], (e) i), , 96, , s, , 10 ( num=, , array.length, , key, , is 24., , digit;, , (b) (ii) arraylj], (c) (i), , loop executes from 0 to, , iterative value of 'i', , f*10;, , s=, , s, , (d) (ii) rev *10, , numbers., , Explanation: array [i+1] =array, , arrayli+1], , Explanation: array [i+1] = key
Page 16 :
taoter, , Boolean Algebra, 10. How can a Boolean function be converted from, , oice questions, t i o l e, c h o i c, , algebraic expression to a product of max, ersal, , gates?, , (a) Using Graphical Representation, , unnv, , halt, , are, , (b) OR, , AND, , (b) Using Truth table, , (d) None of these, name, , of Boolean algebra, , Method, , (c) Using Canonical Conversion, , NAND, , other, , terms., , is, , (d) Both b and c, 11. What is the De Morgan's theorem?, , Aigebra, , (a) (AB) is equal to A'+B.", b) (A B) is equal to A' *B, , Linear, algebra, , Arithmetic algebra, , +, , (c) A+B' is equal to A'B", , Sitchingalgebra, of, to pertorm product, NE Want, , Soean, , function, , must, , max, , terms, the, , brought into, , be, , (b) OR terms, , NANDterms, , (d) A'+B=A'B', form of A, 12. which is the reduced, , NAND terms, , (b) AB +BC, , for, is the expression, Which of the following, 280rption law, , () (A +B) (A +C), (d) (A +C)B, , a A+AB =A, , 13. Which of the, , bA AB-B, A-Bis equal to B + A, , (c) 0, , (b) Inverse property, (d), , Identity element, , ASsociative law, , , Four values, , (b) (), (d) ), , Algebra, 0 is, , a, , (b), , Two values, , (a) Commutative property, , (d), , Five values, , (b) Additive identity, , Metedence is, , (c) Associated identity, (d) ldentity element, , Parentheses, OR, , (b), , AND, , 16. Which, (d) NOT, , ABC, , (b) A+ B+ C, , ABC, , (d), , +B+C, , A, , Tunction A'B'C'using, , 8')+B+C, , (b) (A, (d), , A, , +, , theorem, , and, , +C', , and, , Addition, , (b), , Subtraction, , (c), , structure, , with two Mathematic, , used in Boolean, , (a), , (d), , B)+ C, , +B, , algebraic, , operations are, , B+CY is equal to, , A+B+C, , symbol, , of AND operation?, , (a)(), Boolean, 15. In, , Boolean expressions, the first operator, , is the, , according, , theorems, , (c) (), , oiean algebra is a set of, , Ihreevalues, , x.x, , (d) x, , the, 14. What is, , Y=YX is the, , Commutative law, , for, , (b) 1, , (a) x, , u evalu, , following is correct, , to Boolean Algebra, , equal to A, , is, , BC, , (a) A'B+AB'C, , (d), , NOTterms, , ABAA, , +, , algebra, , subtraction, , and multiplication, , Addition and, , multiplication, , Addition and division, , 17. What do, , we, , call the, , logical product, , logical, , terms ?, , sum, , of, , two, , or more
Page 17 :
276 |, , ISc, , CHAPTERwISE MCQs (Computer, , (a) Sum of, Product SOP, (b) Product of Sum, POs, (c) OR operation, 18., , Science, , XIl, , 27. (x*y)*z=x"(y°z) is the, , (a) Commutative property, , (d) NAND operation, , (b) Inverse property, , Which, , (c) Identity element, , of the, 0 0+X=X?, , following property is correct for, , (a) Commutative property, , 19., , (c)Associative, property, (d) Identity element, , (c)0, 29. Which is equal to X.X'., , Identify the correct identity, , (a), , element wrt addition, , (6) x+1, (d) x+0, , What do, you understand, by Sum of Product?, (a) Sum of, Minterms, (b) Sum of, Maxterms, (c) Both a and b, , 30. What do, , call an, (a) Prime function, , (a) Y, , What is the other, name of, (a) Logical multiplication OR relation?, , (c)0, 32., , 33., , of, , these, 22. What is, the other name, of, (a) Logical multiplication AND relation?, , 34., , (c)LogicalSubtraction, grouping, , must be, (a) 2, , (c), , 24., , cells within, , combined in groups, , 35., a, , of, , K-map,, , the cells, , Commutative, , () AB =A +B, 26. (A + B)(A' *B') = ?, , is the, (a) AND, , (b) AB +C, , (d) AB+A, , complement of, , complement, , Law of, , (b) 0, , (c) AB, , (d) AB, , and, , ), , their, , be the, , smaller, llest number of g, , 2 pairs types formed for, , (6) The, , reduction, , (ii) 1 pair, , (iv) 3 pairs, , reduced, function given appearance, ) AB+AB above is:, , 37., , invo, , (b) Addition, (d) Subtraction, , (iil) 4pairs, , for two, , (b) A+B =B+A, (d) None of these, , (a) 1, , is, , Simplify the following, F(A, B, C)2(2,3,5, 4) expressions:, (a), What will, , integrated., , addition, , (b) OR, (d) XOR, of NOR?, (b) OR, , (d) XOR, Which of the, the inverter following logic sense, circuit ?, (c) Boolean variable, , 36., , (a) It can be found in, almost all, (b) It can be used to build all digital circuits., other types of, (c) These are used in all, countries of the gates., world., (d) These were the first, gates to be, , (a) A +B= A.B, , What, , (b) 1, (d) X, , (a) Division, , (b) 1,2,4,8 etc, , (d) 3, NAND and NOR, are, gates, also called, gates because, Universal, , variables, , (d) A'B AC, NAND is the, , (c) NOT, , 4, , 25. State the, , Solve Y AB (A +B)C, , (a) AND, (c) NOT, , (b) Logical addition, (d) None of these, When, , Exclusive OR, b) Undefined ftun, (d) Odd function, , (a) AB AC, , (c) Logical Subtraction, , (d) None, , we, , (c) Even function, 31. X+XY=, , (d) Max terms, , )A, (d) A, , (b) 1, (d) X, , ()X, , (b) Logical addition, , 23., , According to Boolean Law, A+1=, , (a) 1, , ()X-0, , 21., , 28., , (b) Inversion property, , (a) X-1, , 20., , (d) Associative property, , Gii) A+B, , Given the Boolean, (a), , of the Bo, , (i) AB+BA, , (iv), , A, , ression A'B+, AD CD, expression, Complement, of, the, ) (A, expression, (ii) (A +B')NC*", (ii) +B)C +D), (A', , +BYC +D), , idertd, , (iv) (A +BYc
Page 18 :
Boolean Algebra | 277, (b) A + (B+C) = (A + B) +C, The, law, used:, , Distributive, , () A+ (B+ C) = (A + B)(A + C), , Law, , (d) A +B+C-A + B++C, , Law, , Morgan, , 47., , N a m e the correct law for X(Y + Z) = XY + XZ., , iyDe, , ( g iA, ) s s o c i a t i v eL a w, , ), , (a) Commutative law, , l d e m p o t e n tL a w, , (b) Associative law, (c) Absorption law, , inthe, blanks, , is done, , (d) Distributive law, , operator., , iby, , 48. What do you mean by Minterms?, , addition, , (b) AND, , vical, , binary variables, Sum of binary variables, (c) Difference of binary variables, variables, (d) Complement of binary, (a), (b), , (d) NOR, , C R, , Morgan's, , De, , tto, o, , of, vnig/ement, oment of, , is equal to, , of variables, , sum, , a, , the, , Theorem,, , N O T, , Hiording, , of, the variables., , Product of, , 49. Whatis Maxterms?, nent, , Sum o fc o m p l e m e, , variables, (a) Product of binary, variables, (b) Sum of binary, variables, (c) Difference of binary, variables, (d) Complement of binary, , Complement ofproduct, P r o d u co, t fc o m p l e m e n t, , term, , ) A, , Sum, , invented, , system, , 4, , by, , mathematical, f o r formulating logical statement with, , smbol is, , called, , Boolean, , used in Boolean, values 0 and 1, , alled, , Boolean values, is, , by, , a, , Boolean elements, , and is, , (d) Product, terms, , are, , multiplied by, , final expression, multiplication, the, , 5. A(A + B), , is a, , 4-(v), 5-(iv), , 4-(), 5-(iv), 1-(6), 2-(iv), , 5-(v),, (c) 3-(ii), 4-ii),, 1-(v), 2-(i), 3-(iv), (e) 4-(i), 5-(i),, the, 51. Match, , columns:, , Group B, , Group, A, , Product of sum, , (b), , Complement, , (d), , and theBives, lDle, , Constant, , of logical, , variables, , combinations, , results, , of given, , Arithmetic, , operations., , (b) Logical, (d) Literal, , ative law of addition is, , )A+B-B +A, , 4., Complement, , M.(-M+ N) =, , (ii), , forms of, , M.N, , Boolean Expres(iii), , gates, (d), , SOP and POS, , sions, , of, , (b) Operators, , R,Expressi, ANDandon NOT are the ., 2Relational, , 2., , canonical, , (i), , 3. universal logic, , elues., 3, Truth table, , 1. Simplification law, , Sum of product, , all the values, , ), , a pair, , 4., , form., 5, , (ii) 2, (iv) A, (v)_ X, , 3-(v),, (b) 2-(ii), 1-(ii),, , (b) Complement, , Or more s u m, , 3., , 1, , Cii) 3, , a quad, , 3-(),, (a) 1-(ii), 2-(ii),, , variable., bar over the, , um, , ean, , of, , variable, , (i), , a n octect, , 2., , (d), inverse, , ) Inversion, , wO, , algebra, , Boolean constants, , a, , Group BB, , Group, , (b), , Boolean digits, dicated, , columns:, 50. Match the, , (d) Robert Noyce, , 9) Presper Eckert, , inary, , algebra, , (b) John Mauchly, , George Boole, , Match the following, , logic gate, , that pro, , | (iv), , vides high output, , (a) 1-(i), 2-i), 3-(iv), 4-(ii), , (b) 1-6i), 2-(i), 3-(iv), 4-(ii), , ()1-6i), 2-6i), 3-(tii), 4-(v), , (d) 1-(i), 2-(iv), 3-), 4(ii), , X-NOR, , NAND and, NOR
Page 19 :
278 |, 52., , Isc, , CHAPTERwISE MCQs (Computer Science, , - XII, , the columns:, 53. Match, , Match the columns:, 1., , Group A, , Group A, Addition of vari, , (i), , ables, 2., , C+CD, , 3., , OR operation, , 4., , Absorption law, , GroupB, , Group B, A+ 1, , 1., , C, , 2, , involution of A, , 3, , A(A, , +, , B), , A, 1, , (iii) (AB) N, , =, , (ii), , maxterms, , (ii), , A+AB = A, , DeMorgan's, , (iv), , Associative, , theorem, , (iv) A, , (a) 1-i), 2-0), 3-iv), 4+(ii), (b) 1-), 2-(i), 3-(iv), 4-(ii), () 1-(i), 2-(i), 3-(ii), 4-(iv), , properties, , (a) 1-(i), 2-6i),, 3-(iv), 4-(ii), , (1), (1), , =, , (b) 1-6i), 2-(i), 3-(iv),, 4-(ii), (c) 1-ü), 2-i),, 3-(i), 4-(iv), (d) 1-i), 2-(iv), 3-(),, 4-(ii), , 0, , (d) 1-(i), 2-(iv), 3-(i), 4-(ii), , Answers, , Multiple choice questions, , 10. (d) Both b and c, , 1. (c) NAND, , The NAND, Explanation:, gate is, since, it can, , 2., , 3., , implement, functions., (d) Switching, algebra, (b), , universal gate, , n, , ,, , a, , sum, , variables appears, , A+ AB =A, , term in which, , -, , 5., , 6., , and, , (i) X(X + Y), , =, , X., , (A+By = A'.B', XY, , 12., , Explanation: X, , (b) Two values, Explanation: Boolean, two-valued logics., , XCommutative Law., algebra, , is the, , algebra, , Explanation: Expressions, always evaluated first., , 14., , Boolean, , 16., , 3., , 17., , (A, , +, , B).(A +Q)A, , to A', , identity, 0 is, , X, , +X= Xldemf, , +B, , additive, , identity as, identity is that the sum, zero is the, of, ot anything, (C), , same, , as, , Addition and, , the, , The, , ay, ginal "anything, origit, , multiplication, POS, , (b) Product of, Sum, , Explanation:, The, logical, , logical sum ot t, product terms,, is called S", product). The, logical product ot two, logical sum terms, , Explanation: 1. (A'B')y= A + B, A', , Thus A'B'C' = (A + B+C, , (a) (ABY is, equal, (b) Additive, , Explanation:, , are, , 2. (AB)- A'+B, , (AB)Y, +B, 3. (A +B) =A'B', , =, , X=X (ii), , Law, , Explanation: 1. (A'B')= A + B, , 2., , (B.C), , Explanation: (i) X, , of, , 8. (a) A'B'C, , (A +B) =A'B', Thus (A + B+C)=, A'B'C', A'+B', (d), +C, , +, , 13. (a) X, , 15., , inside brackets, , A, , Distributive Law, , 7. (a) Parentheses, , 9., , (C) (A +B) (A, +C), , Explanation:, , (a) Commutative law, Y =Y, , Conversion of POS form to, standard POS for, Canonical coversion method, (a) (ABY is equal to A'+ B°, , Explanation: (A.B)' =A' +B, , once., , Explanation:, Absorption law states that (i) X+, X, , matheemat, , functions, , propositional calculus., 11., , a, , logic-specifically in conne, algebra, boolean, , with Boolean, , OR terms, of the, , (a), , a, , A truth table is, , table used in, , the AND, OR and, NOT, , Explanation:, Maxterms., each, 4., , Explanation:, , 18., , sums)., , n, , is called POS (i.e. Pr, , (a), , Commutative property, Explanation: Commutative, interchanging of the La, order, , tatesthat, , en0
Page 20 :
Boolean equation does, does not, , eauation, , enample, , change, , its result. For, , A B=B+A, , 279, , (1 or HIGH) output, is odd., the number of true inputs, , when, , gate that gives, , true, , a, , 31. (d) X, , erator>, , Explanation: X +, , erator > A *B =B*A), , OR, , Boolean Algebra, , X*Y=, , X»(1, , +, , Y), , =, , X*1, , =, , X, , A N Do p e r a t o, , 32. (b) AB'+C, , (d) x, , (A' + B)C =AB' + (AB'YC=, +C).1 =(AB +C)., (AB+C(AB' + (AB')) (AB', , +0, , Explanation: Y AB', , A +0=A Al=A-identity element., , lanation, Minterms, Sum of, (a), , =, , =-, , 33. (a) AND, , 1.6)Logicaladdition, , Explanation:, Boolean, , logical, , The, , symbol, , inclusive disjunction, components, , are, , is, , an, , true if, , either,, , is, , inclusive, or, , An, , an AND gate., , both, of, , 34. (b) OR, , true., , Explanation: The, , multiplication, , 2 (a) Logicaletc, 1,2,48, 23(6), , cells, K-map, the, , cells, , within, , 35., a, , be combined in groups of 2,, , can, , 4,8, etc., , 24., , (b) It can, , other types of gates., be used to build all, and NAND gate are, NOR, , gate, , The, , Explanation:, , universal gates. This, any, , logical, , Boolean, NAND, , gates or only, , means, , that you, , expression using, , Commutative, , can, , create, , only, , NOR, , OR operator, , >, , A, , +, , variable, , 36. (a) (i) 2 pairs, , (b) i), , B =B +A. AND operator, , >A, , AB, , +, , AB, , Explanation:, , B00 01, BC 1B 10, , A, , Law states that the, , Explanation:, in a, of the order of operands, interchanging, Boolean equation does not change its result. FOr, , example:, , the, gate represents, , (c) Boolean, variables can either be True, Explanation: Boolean, values., stored as 16-bit (2-byte), or False and are, , gates., , 5.(b) A+B =B+A, , NOR, , complement of the OR operation., , grouping, , When, , Explanation:, , combination, , Explanation: NAND gate actuallya, followed by NOT, of two logic gates: AND gate, of, is complement of the output, gate. So its output, , is used, , statements., , two, , between, , disjunction, its, , OR, , algebra to indicate, , in, , +, , Loop, , D, , Loop 2, , 37. (a) (i) (A + B)(C'+ D), , Law, (b) (i) De Morgan, , Fill in the blanks, , B BA, 26. (b) 0, , 38. (a) OR, , Explanation: (a + b)(a' b'), , Explanation: Boolean, , =(a'b'}a+b), , OR logic function., , Theorems 1. The, Explanation: De-Morgan's, to, is, complement of a product of variables equal, variables., the, the sum of the complements of, , =0°b +a"0, =0+0 (Theorem 3), 0, , (d) Associative, , 28.(a)1, , 40. (a) George Boole, , property, , 41. (b) Boolean constants, , Xplanation: A+ 1 =1 - Annulment, , Explanation:, , 29. (a) 0, , A, , Boolean constant, , can, , have, , two values, TRUE and FALSE, where TRUE is, , planation: X X =0, Law., , X+X', , =, , 1, , Complement, , XOR gate, , equivalent to 1 and FALSE is equivalent to 0., 42. (a) Inversion, , 30.d)Odd function, planation:, , equivalent to the, , 39. (c) Product of complement, , a'b'ata'b'b, , ., , addition is, , (sometimes EOR, or EXOR, , dpronounced as Exclusive OR) is a digital logic, , Explanation: The complement is the inverse of a, variable and is indicated by a bar over variable.
Page 21 :
280 | IsC CHAPTERWISE MCQs (Computer Science)- X, Associative, , 47., , 43., , (b) Sum of product, i5, Explanation: The Product of Sum expression, equivalent to the logical OR-AND function which, gives the AND Product of, to, , two, , or more, , OR Sums, , produce an output., , the multiplying or factoring out, ut of, , of an, , A.CC, , A(B +C)=A.B +, 48. (d) Complement of binary variables, , combination of values of the a, , table that shows the truth-value of, , otherwise., , a compound statement for every truth-value of its, , component statements als0: a similar table (as for, , Explanation: A maxterm is a Booleaner, resulting in a 0 for the output of a s, , output for each value of each input., 45. (a) Relational, , expression, and 1s for all other celle, , Explanation: The logical operators *AND and, OR specify the relationship between operands in, a logical expression. The logical operator *NOT is, , Karnaugh map, or truth table., , Match the following, , used to negate logical variables or constants., 46. (b) A+ (B+C) = (A +B) +C, , 50. (a) 1-(i), 2-(ii), 3-60), 4-(V), 5-(iv), , Explanation: Associative Law - This law allows, , 51. (a) 1-(i), 2-(1), 3-(iv), 4-(ii), , the removal of brackets from an expression and, , 52. (a) 1-(iü), 2-(i), 3-(iv), 4-(ii), , regrouping of the variables., , 53., , (B+C), , =, , (A +B), , variables,, , 49. (a) Product ofbinary variables, , a computer logic circuit) showing the value of the, , A+, , exptes, , Explanation: Each minterm = 1 fh, , 44. (a) Truth table, , Explanation: a, , law, , (b), Explanation: Distributive Law -Th, , +, , C=A+B+C), , (a) 1-(iü), 2-(i), 3-(iv), 4-(ii)
Page 22 :
C, , h, , a, , p, , t, , e, , r, , Computer Hardware, , 2, , (a), , Aultiple c h o i c e q u e s t i o n s, , (OAI), , OR-AND invert, , (b) AND-OR invert (AOp), What, , 1, , basic, , are, , gates from the following?, (6) NAND, , (a) NOT, , (d), , ( ) AND, , 2, , When, , two, , NOT, AND & OR, , an XNOR produces, , inputs are, , (c), , Both AOI and OAI, , (d), , None of these, , form of DCVS logic?, 9. What is the standard, Switch, Differential cascade Voltage, , (a), , Voltage Static, Switch, (c) Differential Complex Voltage, (d) None of above, , (b), , an output., , (b) Low, (e) High, , (d) Same, , (9) Different, , correct, , logic Gates thatprovide output, s a m e (either 0 or 1), , 3Choose the, are the, 0 when both inputs, , Differential cascade, , 10. What, , are, , the, , advantages of static complementary, , gates?, , as, , (b), , (b) XOR, , (a) Reliable, , (d) NAND, , (c) Not reliable, , Not easy to, , use, , (a) XNOR, , (c) NOR, , 4.ldentify, (a), , (b), (0), , gates from the following., , the universal, , gates, , NAND and NOR, , NOT and XOR, , categorise, , we can, , (a) 1, , (b), , 2, , (c) 3, , (d), , 4, , the, , (a), , logical, , (b), , Sum of products, , (d), , (c) Both, , gates, , b) 2 grouP, , a) 1 group, , s u m of, 13. What is the, & known as?, , (d) 4 group, , () 3 group, , Gate is represented, , logic circuit given, , use, , canonical, alternative form of, 12. What is the, , (d) OR and XOR gates, 5. In how many groups, , Reliable and easy to, , transistors have?, terminals do Mos, 11. How many, , gates, , AND and NOT gates, , .Which, , (d), , by, , product, , Product, , (b), , None of above, canonical, , Disjunctive Normal, , form, , (d), , None of these, , other n a m e of the, 14. State the, canonical forms?, , (a) Maxterm expansion, (b) NOR, (d), , laentify the arithmeticgates, , Complexlogicgates?, , Normal, (b) Conjunctive, , NAND, , form, , (c) Both, , from the following?, , (d), , (a) NOT, (6) NAND and NOR, () X-OR&Xx-NOR, d) NOT, AND &OR, , 8. mong the following, , forms also, , (c) Both, , A, , c) AND, , of Sums, , (a) Minterm expansion, , the output of the, , below, , a) OR, , form?, , 15., , None of these, , Identify the identity, , law?, , (a) a+0=0+a=a, , which, , are, , the forms of, , (b) 1+a=a+1=1, (c)ab =ba, (d), , a+, , (b+ c) (a +b) +C, =, , product of, , sums
Page 23 :
282, 16., , |, , Isc, , CHAPTERWISE, , MCas, , (Computer Science, , Choose an, example of dominance, (a) a +0 0+ a a, , ) -, , XII, , 27. From the logic diagram given, and B are inputs and X is the, , law:, , =, , =, , (b), , 1+a =a+1, , =, , o, , following questions:, , 1, , (c) ab = ba, , (d), , a+, , (b, , utput, ansh, , (1), , c) (a +b) +c, Which of the, following is, , 17., , above, w, , +, , =, , distributive law?, , example, , an, , of, , (a) a +0 =0+ a a, (b) 1+a =a+1 =1, (c) a+bc (a, +, , (2), , =, , (a) The expression at (1) is:, , =, , b)(a +c), (a +b) c, do, Why we use combinational, Logic?, (d), , 18., , a, , (b+c), , =, , (i) A'B, , +, , (b) The expression at (2) is:, , (a) Compute outputs, , (b), , i) AB', , Compute new states, , (c) The Final expression is:, , (d) None of above, Which methods, , i) A'B+AB, , are, , integer numbers?2, , used, , (a) 1's complement, , (a), , 1, , to, , (d) All of above, , many types of number systems, , (c) 3, 21. For which, , (d) 4, , A, , (d) Octal, , characters, , are, , Interchange?, , (b) 25, , (d) None of above, , 23. Which number, , system, , has base 8?, , (a) Binary, , (b) Hexadecimal, , () Decimal, , (d) Octal1, , 24. How many types of IC packages are there?, (a) 1, , (b) 2, , (c) 3, , (d) 4, , 25. Number of categories of ICs., (a) 1, , (b) 2, , (c) 3, , (d) 4, , vast scale integration contain?2, 26. How many gates do, , (a) 100 gates, to 100,000, , (c) 10000 gates, of above, , gates, , (iii), , there in the American, , (c) 128, , (d), , (i), , is 16?, , (a) 64, , None, , B, , there?, , C, , standard code for Information, , (b) 10,000, , diagram given above, where, inputs and X is the output, answe, following questions:, , b) Hexadecimal, , (c) Decimal, 22. How, many, , (iv) AB + A, , 28. From the, logic, and C are, , b) 2, , number system the base, , (a) Binary, , are, , (i) A + AB, , (i) AB+B, , represent negative, , (b) Sign magnitude, , (c) 2's complement, 20. How, , (i) AB, (iv) B, , (iii) A, , (c) Both, 19., , i) AB, (iv) B, , (ii) A, , (a), , The, , (b), , () BC, (iii) A, The, , expression at (1) is:, (ii) AB, (iv) B, , expression, , 1) AC, (Gii) A, (c) The, , (c) 0110, , (3), , is:, (ii) AC, (iv) B, , expression is:, (ii) A+AB, , (iv) AB+A, , blanks, , 29. The, one's, , (a) 0101, , is:, , (iv) B, at, , (i) BC+ AC + AB, (ii) AB+ B, , Fill in the, , (2), , (ii) AB, , expression, , (i) AB, (iii) A, (d) The Final, , at, , complement of Binary, , Number10, , (b) 1010, (d) 1110
Page 24 :
Computer Hardware, , mplement of Binary Number 1010 is, , (c)Both data selector and data distributor, , 0 The 2, , (b) 1010, , 40., , (a)0101, , (d) 1110, , ( ) 0110, , are, , used, , Adders, (, , a, , ), , A, , d, , d, , r, , e, , s, , s, , e, , s, , All of, , Total, , above, , Lumber of inputs, , in, , half adder is, , a, , (b) 3, , (a) 2, , possible for, expansion of MUX, it is, , undergo, , an, , (b) Outputs, , (c) Selection lines, , (d) Enable lines, , Match the followinng, 41. Match the columns:, , Group B, , Group A, , operation carry is obtained., , 3. In, , to, , 1., , (i) Encoding, , adder, , 3 inputs and 2, , (ii), , 2. Half adder, , (a) Subtraction, , outputs, , (b) Addition, , TeA4., Wer, , addition and subtraction, (d) Both, of a half adder, the, If A and B are the inputs, , 4., , (d), , A XOR B, , 35. If A and B are the, , inputs of a, , (a) 1-iv), 2-(ii), 3-(ii), 4-(), (c) 3-(iv), 4-(ii), 1-(6i), 2-), , A EX-NOR B, half adder, the carry, , (d) 4-iv), 1-ii), 2-(ii), 3-), 42. Match the columns:, , is given by ., , (a) A ANDPB, , (b) A ORB, , (c) A XOR B, , (d), , 2., , code into, , set of signals is, , (b) Decoder, , (d) Data Selector, , (c) Multiplexer, 38. Multiplexer is, , (a) Decoder that decodes several inputs, , and, , gives, , 4, , (0), , Takes, , that, , one, , converts, , many, , signals into one, , input and gives many, , decodes, (a) A type of encoder that, and gives an output, , 39., , combinational, , outputs, , several, , inputs, , to select, circuit is used, the, direct, &, , inputs, , Single input from multiple, Dnary information to output line, (a) Data Selector, (b) Data distributor, , with, , 8-bit, , | (iii), , 3, , Encoder, , be, , called, , (iv), , 4, , a, , multiplexer, (a), (b), (c), (d), , 1-iv), 2-(i), 3-(i), 4-(), 2-(iv), 3-(ii), 4-(i), 1-4i), 3-(iv), 4-(ii), 1-(i), 2-(), 4-(iv), 1-(ii), 2-(4i), 3-0), , 43. Match the columns:, , an output, A device, , 2^8, , Binary (i), , encoder, , called, , (a) Encoder, , to, , encoder, , (d) Data Selector, a, , OR gates in Octal, , 3. Combinations, , (b) Decoder, , changes a, , yes, , encoder, , called as, , 37. A circuit that, , OR gatesin Decimal to BCD (i), , A EX-NOR B, , device state, 36. Devices which converts an input, zero's is, and, one's, of, into a binary representation, , (c) Multiplexer, , Group B, , Group A, 1., , (a) Encoder, , numbers, , (b) 2-(iv), 3-(i), 4-(i), 1-), , b) A OR B, , (a) A ANDPB, , add two binary, , record music in the | (iv), recorder, , sum, , is given by, (c), , (iii) design circuits, , 3. Full adder, , c) Multiplication, , Group A, 1. Binary number 10101, 2., , Inverter, , 3. Digital circuits, 4 Decimal number 10, (a) 1-iv), 2-(ti), 3-(i), 4-), , (b) 2-(iv), 3-(ii), 4-(i), 1-6), , ()3-(iv),4-(ii), 1-(6i), 2-(), , (d) 4-iv), 1-(ii), 2-(), 3-6), , of, an, , (a) Inputs, , (d) 1, , (), , input, , proficiency, , with the, , ICs, , decrement operators, , Incrementar, , (c), , (d), , enable, , (b) Table indices, , 31., , (d) DeMultiplexer, With digital multiplexer, large number of, , tocalculate, , 283, , Group B, , i), (i), , 1010, , NAND, , ii) NOT gate, | (iv), , 21
Page 25 :
284|, 44., , ISC, , CHAPTERWISE MCas (Computer Scie ce) XIl, , Match the columns:, 1., , Group A, , Group B, , One multiplexer, , Expression based questions, 46. X=, , Strobe, , (i), , can replace, , selectlines required (ii), , 2, , for 8-line-to-1-line, , 3., , (iv) Several SSI, logic gates or, , (c) A+B, , (d) B +A, , (A +B).(A +B) =?, , 49., , (a) B, , (b) A, , (c)A+B, , (d) AB, , gate output will be low if the, , are, , Group B, , secure, , Encoder that converts, rotary positions to, electronic signals, , Encoding, , (ii), , Rotary, Encoder, , (iii), , Email, encoder, , (iv), , messages to codewords, , (a) 00, , (b) 01, , (c) 10, , (d) 11, , Binary equivalent of, , 51., , Simplest line decoder (i), , 4. Converting received, , (b) A+B, , 50. The NAND, , online email addresses, 3., , (a) A +B, , logic circuits, , Group A, , Encoder that, , (b) A+BC+CD, (d) A+BCo, , combinational, , Match the columns:, , 2., , (d) A+B, , 48. A+ AB =?, , (b) 2-iv), 3-(ii), 4-(i), 1-6), () 3-iv), 4-(Gii), 1-(i), 2-), (d) 4-iv), 1-(ii), 2-(), 3-(i), , 1., , ( ) AB, , (c) A +BC, , (a) 1-(iv), 2-(ii), 3-(ii), 4-6), , 45., , (b)AB, , (a) A+BC+DC =1, , multiplexer?, known as, , (a) A +B, , 47. Complement form of.A(B+C) +, , multiplexer, NOT gates required (ii)3, for a 4-to-1, enable input, also, , B+AB+AB=?, , Decimal number 368, , (a) 101110000, , (b) 110110000, , (c) 111010000, , (d) 111100000, , 52. The number of control lines for, , an, , 8, , -, , multiplexer is, (a) 2, , (b) 3, , (c) 4, , (d) 5, , a, , 53. A.B+A.B +A.B =?, , (a) A +B, , 1-2 line, decoder, , (b) A.B, (d) A+B, , (C) A.B, , (a) 1-(iv), 2-(ii), 3-(i), 4-6), , 54. (x, , (6) 2-(iv), 3-(ii), 4-(i), 1-6), , +, , y) (x + z), , =, , ?, , (a)x+ yz, , (c) 3-(iv), 4-(ii), 1-(i), 2-i), 55., , (d) 4-iv), 1-ii), 2-(i), 3-(i), , (b) X, , ()x+x(y +z), , (d) x(1 +yz), Decimal equivalent of, Binary numberll0, (a) 26, (b) 36, , () 16, , (d) 23, , Answerss, Multiple choice questions, , output level of the XNOR, gate is high ou, of its inputs are the same,, eitherOorl, , both, , 1. (d) NOT, AND & OR, , 3. (b) XOR, , Explanation: Basic gates are called the AND gate,, , Explanation: XOR compares two in put bits, , the OR gate, and the NOT gate., , 2. (d) Same, Explanation: The XNOR gate is the complement, , of the XOR gate. It is a hybrid gate. it is the, NOT gate. The, combination of the XOR gate and, , 4., , generates one output bit., , (a) NAND and NOR, gates, , Explanation:, which, , can, , A, , universal gate 15Is a log, , fun, , implement any Boole peot, without the need, to use any other, an
Page 26 :
Computer Hardware, , NAN, ste aand, NAND gate are universal1, nd, , NOR, , The, Sate, , Kats, , systems can be, threc, basic logic gates. These, only, only three, by, the OR gate,, called the AND gate,, All, , E p l a n a t i o n :, , A, , l, , l, , digital, , 17., , (c), , a +, , -, , the, Law states that, the, variables and adding, , Distributive, , Explanation:, , multiplication of, , two, , value, will result in, result witha variable, with, the variable, of addition of, , b a s i c, g a t e s ., , gate., , theNOT, and, , as, , NOT AND that yields, JAND, is a, is false, and false if all, , multiplication, , Explanation:, , an, , ber of, , number, , enever, , and, , XNOR is, , the, , number, , of inputs, , the output is, circuits, where, , even, , Both, , AOIand, , AOI, , planation:, , logic, orComplex) of, , compound, the, c o n s t r u c t e d from, two-level, , are, , gates, , functions, , one or, , gates, , AND, , more, , combination, , 19., , (d) All of, , 20., , (d) 4, , by a, (OAI), OR-AND-Invert, , 9(a), , NAND, , Differential, , logic, , potential, , a, , Decimal, , voltage, , cascade, , 21., , conventional, , circuit, , (d), , 1. (0) 3, , density,, , Explanation:, , has three, , 23., , can, , function, , Normal, , boolean, , Normal, , are, , as, , be expressea, Form, , known, , as, , expressed, , Form, , ., , as a, , sum, , of, , ASCII, , is, , (27) a r e, , (b), , Explanation:, , (c) (i) A'B+AB', , ldentity, Explanation: The, , Laws; it has, , A And. 0 OR A = A, , 6. (b) 1+ a =a+ 1 =1, , two, , expressions:, , 1 AND A, , =, , system,, , Vast scale integration, , 10,000 transistors., , of the, , system,, , gates, 10,000 to 100,000, , ., , minterms, , one, , numeral, , number, , (b) i) AB, Law is, , meaning, 7-bit code,, , that, , defined., , The octal, , 27. (a) i) A'B, , (a) a+0=0+a=a, , a, , 16., , or, , and, , oct for, , uses, , the, , 25. (b) 2, , 13. (c) Both, 14. (0) Both, , 00lean, , of base is, , base-8, , in, , 24. (b) 2, , known a s, , functions expressed, , one, , digits, , 26., , maxterm., , or product o f maxterms., , 15., , (d) Octal, , Canonical, , as, , System is, , techniques,, , characters, , short, is the, 0 to 7., , Boolean, , In, , -, , Disjunctive, , Conjunctive, , 8), , Representation, , Number, , Explanation:, , Form, , Explanation:, , and, , 2), , Number, , 22. (c) 128, , 128, , Canonical, , ninterm, , -, , -, , 10), system (Base, (Base - 16), number system, , (b), , use, , 12 (c) Both, , some, , system (Base, , value, which there, , MOS, Explanation: A, Source., Drain;, terminals. Gate;, , Canonical, , system (Base, , number, , the type of, , NAND/, , delay, layout, , TRANSISTOR, , algebra,Boolean, , types a r e, , Explanation:, , power, , 10., , of the, , Hexadecimal, , over, , and easy to, , Boolean, , by, , function, , Hexadecimal, , switch, , t e r m s of, NOR logic in, flexibility., and logic, dissipation,, , Reliable, , pure, , a, , of, , type, , a, , -, , gates, , techniquethathas, CMOS circuit, , advantages, , +, , Hexadecimal, , Differential, , (DCVS) logicis, , number, , Octal number, , gate., , Switch, cascade Voltage, , Explanation:, , Binary, , Logic is, , AOI, , (A, , above, , Explanation: four main, , followed, , of, The complement, NOR gate., where the OR, , precede a, , BC, , present input only., , asserted., , OAI, , &(C), , is implemented, , which, , digital logic, , inputs are asserted,, whenever an, , asserted, , are, , asserted, , output is, , XOR, XOR, , The, , is, , logic, , combinational, , odd, , +, , 18. (c) Both, , : ( )N - O R, & X - N O R, , Explanation:, , A, , For example:, , B) (A +C)., , condition, , any, , conditionsa r e t r u e ., , thesame, , individual variables., , olanation: N A N, , true i f, , negation of 1 is 0., bc (a + b)(a + ), , 1 then the, , d, , onstructed, , ( d )NAND, , complement, , The, form these laws., is used in the operations to, is, the first number, idea behind these laws is that if, , gate, , group, , Domination Laws: The, , Explanation:, , 285, , 28., , (a) (i), , BC, , (b) (0) AC, (c) i) AB, , (d) (i) BC+AC +, , AB, , contains o v e r
Page 27 :
28, , | ISc, , CHAPTERwISE, , Fill in the, , MCQs(Computer Sclence), , -, , XIl, , Match the following, , blanks, , 29. (a) 0101, , 41. (a) 1-(iv), 2-(ii), 3-(6i), 4-(i), 42. (a) 1-(iv), 2-(i), 3-(i), 4-6), 43. (a) 1(V), 2(111), 3-(ii), 4-(0), , Eplanation: Flip all te bits in the, signed binary, complement representation (reverse the, , one's, , replace the bits set on I with Os and the 44. (a) 1-(iv), 2-(111), S-{11), 4-(i), on 0 with, 1s:, 45. (a) 1-(iv), 2-(ii), 3-(ii), 4-(6), , bits, , (1010)-0101, , 30. (c) 0110, , Expression based questions, , CAplanation:, , To get 2s, , mber is 1s, , 31., , complement, , complement of given, 1 to the, least, significant bit (LSB)., (d) All of, , of, , binary, , number plus, , electronics that is, , of numbers., 32. (a) 2, , digital logic circuit in, , extensively used for the addition, , 50. (d), 1, 51. (a) 10111000, , Explanation: 368/2, , The half adder, circuit has two, and B, which add, two input, a, digits and, and, , carry, , 35. (a) A AND B, , a, , sum., , 5/2-2, remainder is 1, 2/2 1, remainder is 0, 1/2 0, remainder is 1, , 36. (a) Encoder, , Explanation: An encoder is sensor that, detects, angle linear, displacement., Encoders, used in devices, that, a, , rotation, , Read from the, bottom, , or, , 101110000., , are, , need to operate in, high, , speed and with high accuracy., , 37. (b) Decoder, , Explanation: Decoder is combinational circuit, that has 'n', input lines and, a, , maximum of 2n, , lines., , A, , device that converts, , output, , Explanation: A multiplexer (MUX)signals, is device, that, , can, a, , many, , into one, , a, , receive, , multiple input signals and, synthesize, single output signal in recoverable manner, a, , for, , each input signal, 39., , (b) Data distributor, , Explanation:, , combinational, information, , A, , digital multiplexer, , circuit that selects one, from several sources and, , is, , a, , digital, , transmits, , the selected information on a, single output line, depending on the status of the select lines. That is, , why it is also known as a data selector., 40. (a) Inputs, , remainder is n, , 46/2 23, remainder is0, 23/2 11, remainder is1, 11/2 5, remainder is1, , Explanation:, , (b), , 184,, , =, , 184/2 92, remainder is 0, 92/2 46, remainder is 0, , 34. (c) A XxOR, B, , 38., , A + BC +CD, , 49. (b) A, a, , 33. (b) Addition, , inputs: A, generates, , (d), , 47., , 48. (c) A+B, , above, , Explanation: An adder is, , 46. (a) A +B, , 2, , (6), , (MSB), , to, , top (, , 3, , Explanation: There are 3 control lines, fotr, , 1, , Multiplexer. The control signals, , steer any, , one, , 53, (a), (a) A+B, 54. (a) x +, yz, , of the, , Explanation: XX, , YZ=X+ YZ, , +, , eight inputs, , XY, , +, , to, , are, , uil, , the outr:, , XZ+YZ =X(1 +, , 55. (a) 26, , Explanation:, , (11010), (26)10, Write down the, binary number, 11010, =, , Multiply each digit of the binary number b', , corresponding power of two:, , Ix24 +1x23+0x22 +1x21 +0x20, , Solve the powers:, , Ixl6+, 1x8+0x4 +1x2 +0xl, Add up the, , 16 +8*0+2, numbers written, abOVE, 16+8+0+2+0-26., This is the decInralequ, of the, binary number 11010., =
Page 28 :
Implementation of, Chapter, , algorithms to solve, , 3, , problems, Identify the algorithm, , 8., , utiple cnoice questions, , designed, , which cannot be, , without recursion, worst-case, , run-tin, , complexity, , in, , binary, , Tower of Hanoi, , (a), , The, , (b) Fibonacci Series, , search algorithms, , (b) Ofnlog n), , (a) On2), , do, , (d) None of the above, , (d) O(n), , (o) Ofn3), ,What, , () Tree Traversal, , by, , understand, , you, , linear, , data, , maintain, following sorting algorithmssorted, , 9. The, , sub-lists, one sorted, , and, , (a) Selection Sort, , (b) Stack, , All of the above, , (d), , (c) Arrays, , 3.The travelling, , salesman, , 10. A posterior, , (c) Recursive Approach, , (d) Divide & Conquer, 4State the searching technique, form, to be in sorted, , which do not require, , Linear Search, , 12. Which, , All of the above, , Non-lncreasing, which is in, 3.Choose the series, , (b) O(n), (d) On2), , of the following, , uses, , (a) Queue, , 1, (b) 9,8, 6, 3, 4,, , (a) 1,3,4, 6, 8,9, , 13. A, , (d) 1,3,3,6, 8,9, , (9 9,8,6,3, 3, 1, , binary heap,, , the, , rightmost, , roots, , the, substituted by, level is, Component of the last, the, be, will, removed. What, Where the root is, , 0, , complete graph can, n2, , (b), , nn-2, , (c)nn +1 spanning, , trees, , a) It is the easiest, , possible way., , that it is still, , a, , 14. From the, , complete binary, , tree., 9Because the left and, , right, , subtrees, , might, , trees, , options given below, identify, , is not the divide and conquer approach?, (a) Insertion Sort, , (b) Merge Sort, , (c) Shell Sort, , (d) Heap Sort, , missing, , 15. Prefix notation is also known as, in, , asymptotic, , evaluation, , (a) Reverse Polish Notation, , (b) Reverse Notation, , Tepresents, , which, , be, , (d) None of the above!, , The notation, , spanning, , Tree, , trees, , trees, , nn, , (b) Stack, , have, , spanning, , (d), , reason?, , spanning, , (a), , FIFO method?, , Search, (d) Binary, , (c) Hash Table, , Order., , a) Base case, c) Worst case, , than Piori, , time complexity, , worst-case, , (a) O(1), (c) O(log n), , (6) Interpolation Search, , sure, , accurate, , search algorithms?, , (a) Binary Search, , 0) lo make, , more, , (a) it contains, factors to be dynamic., undertakes all other, (b) It, to be constant, all other factors, (c) It undertakes, of reverseengineering., (d) It is a result, of linear, 11. What is the, , the data, , USing, , analysis is, , both A &B, , the actual data., , (b) Greedy Algorithm, , (b), , be, , analysis because-, , (a) Dynamic Algorithm, , (, , (d), , (c) Merge Sort, , of, problem is an example, , to, , (b) Insertion Sort, , s t r u c t u r e -, , (a) Queue, , one, , two, , -, , (b) Average case, , (c) Polish Reverse Notation, , (d) NULL case, , (d) Polish Notation, , one
Page 29 :
288 | isC CHAPTERWISE MCQs, 16. In, , order traversal, of, , produce, (a) unsorted list, , binary, , search, the, , reverse of, , (c) sorted list, , (d), , 26., , a, , contra ot, , a, , min-heap:, , (b) False, , 27. Stack is used for, , above, , (a) CPU Resource Allocation, , parent nodes have values, to their child, , their child, (c) both, statements, (d) both, statements, , 18. A, , (b) Breadth-First Traversal, more, , 19. For, , a, , binary, , (list) must be, , search, , than, , (c) Recursion, , equa, , (d) None of the above, , than, , or, , equal, , to, , 28. A, , are, , is, , called, 29., , dynamic protin., Tamn, , (a) Fibonacci Series, , (b) Tower of Hanoi, , the array, , (c), , stack, , Dijkstra Shortest Path, , (keys), found, , (b), , (b) lists, , (c), , (d) trees, works on, 31., , (b) 2k+1 -1, (d) 2k-1, , is, , graph?, , used for the, , (b) stack, (d) none of the, above, , (c) list, , 24. Name data, structure that is used for, the, first traversal of a, , graph., , Which data structure, , breadth-, , (b) stack, (d) none of the above, , (c) list, can, , be used to, , syntax has balanced parenthesis?, , (b) tree, (d) stack, , node.next ->, , check, , if the, , above, , node.next.next; will make, , (b) node.next.next inaccessible, , (c)this node inaccessible, (d), , depth-first, , of the, , (a) node.next inaccessible, , a, , structure, , Complete Binary Tree, Binary Search Tree, , (d) All, , (b) FIFO, (d) none of the, above, , () 2k-1+1, , (key) s right si, , (a) Binary Tree, , in, , highest number of, in, binary tree with, height k, where the rootnodes, is, height 0, is, (a) 2k 1, , (c) list, , a, , following formula is of, left_subtree (keys) s node, , 22. The, , (a) queue, , instance of, , 30. The, , (a) LIFO, (c) FILO, , (a) queue, , Queue, , is an, , (d) All of the above, , (c)stacks, Queue data structure, , (a) queue, , Which, , approach?, , algorithm to work,, , (a) queues, , a, , list can use, for, , b) Queue, (c) Both Stack & Queue, (d) Neither Stack nor, , wrong, , push() and pop() functions are, , 23. What data, traversal of, , circular linked, , (a) Stack, , (a) sorted, , (b) unsorted, (c) in a heap, (d) popped out of, , or, , are true, , procedure that calls itself, (a) illegal call, (b) reverse polish, (c) recursive, (d) none of the above, , 25., , Postfix expression is just, expression., , O parent nodes have values, less, , 21., , will, , input, , none of the, , (a), , 20., , tree, , (a) True, , (b), , 17. In, , (Computer Science), , none of the, , Fil in the, 32., , above, , blanks, , Visiting, root, trees is callednode after, (a) In-order Traversal, , visiting left ana g, , b) Pre-order Traversal, (c) Post-order Traveller, 33. The, , worst-case, matches, with complexity, (a) interpolation search, (b) linear search, , (c)merge, (d) none sort, , of the, , above, , o binary S
Page 30 :
Implementation, , Algorithm, , Ptap, , does not, , divide the list., , ofalgorithms to solve problems|, , 289, , Match the following, , o ), L i n e a r, s e a r c h, , 42. Match the columns:, (, , b, , ), B, , i, , n, , a, , r, , ys, , e, , a, , r, , c, , Group B, , h, , Group A, , to, time it take, , 1), , ( c ) M e r g es o r t, , ., , Completeness, , 2., , Time Complexity (ii), , find a solution, , ( d )Q u i c k s o r t, , of, , example, , an, , is, % Heap, , binary, , memory, , need, , to perform the, , tree, , search, , complete, , a), , Is the strategy, which we find, , Space Complexity (ii), , (b) spanning-tree, , 3., , by, , (0) s p a r s e t r e e, , d), , binary, , uicksort, , (a), , the solution., , tree, , search, , size of, , running, , time, , depends, , on, , the, , selection, , 3-6), (a) 1-(ii), 2-(),, 3-(i), (b) 1-0), 2-(ii),, 3-(), () 1-(ii), 2-0),, , array, , (d) 1-(1), 2-(ii),, , (b) p i v o t e l e m e n t, , ( c ) s e q u e n c eo f v a l u e s, , (d), , none, , of the, , the, 43. Match, techniques, , Group B, , Group A, , above!, , sorting, , 3-(ii), , columns:, , has highest, , (i) O(n), (ii) O(n2), , Bubble Sort, , -, , 2., , complexity, , runtime, , best-case, , (a) Quick sort, , (a) 1-i), 2-(i),, , 3-(ii), , 2-(i),, (b) 1-i),, , (c) Insertion s o r t, , (d) Bubble sort, , sorting, , algorithms, , are, , not, , 2-(ii),, (c) 1-i),, , stable?, , (d) 1-(m),, , O(n log n), , (ii), , 3. Selection Sort, , (b) Selection s o r t, , ubte, , Shell Sort, , 3-(), , 3-(i), , 2-4i), 3-(ii), , Numerical b a s e d questions, (a) Selection Sort, needed, , (b) Bubble Sort, , which, , 44. The, , (o) Merge Sort, , number, , numbers, , (d) Insertion Sort, can, , be used, , for_, , using, , the, to s o r t, , are, , of swaps, 13 in, 7, 9, 31, 5,, , order,, ascending, , 8, 22,, , bubble sort, , is, , (b) 12, , d a t a - s t r u c t u r e, , 9. A queue, , (a) 11, , (a) expression parsing, , ), , (d) 10, , 13, essential, , C), , to, , s o r t the, , given, , are, , b) recursion, , many swaps, 45. How, , resource allocation, , array using, , bubble sort, , without, , above, (d) all of the, , cannot, , be designed, , (a) 4, , 3,, - {2, 5, 1, 4, (b) 5, (d) 7, , _algorithm, , 40., , (c) 6, recursion., , hts, , sum, 46. The, , Tower of Hanoi, , (a), , of binary, , traversed, , trees with, , 3, , in post-order gives, , nodes, , the, , which when, , sequence, , A,B,C, , (b) Fibonacci Series, , is?, c) Tree Traversal, , (d) None of the, *, , theres, , no, , above, , base, , criteria, , in, , a, , recursive, , (a) not be executed., execute, , until all, , (d) 6, , program,, , ()5, , if there is, be the worth of top,, 47. What will, 5, stack STACK_SIZE is, proportion of, , the program will, , (D), , (b) 4, , (a) 3, , match., conditions, , () execute infinitely., approach., a) Obtaina progressive, , )5, (c), , 4, , (b) 6, (d) None, , a
Page 31 :
290| IsC CHAPTERWISE MCQs (ComputerScience), 48. The minimum number of comparisons, to find the minimum and the, maxinmun, , C, , 24?- arr[jl;, ential, , j=?5?;, , numbers is, , 49., , arrlj+1=key;, , (a) 148, , (b) 146, , (c) 147, , (d), , State the Huffman code, , (a), (b), (), (b), , tor, , 100, , a,b.cd.e?, , the letters, , Answer the following question:, , 0,10,110,1110,1111, 10,011,11,001,010, 10,01,0001,100,1010, 100,110,001,000,010, , 50. Out of 4, , the statement or, , (iv) -1, , (i) length, , distinct keys, how many distinct primary, , What is the statement or, , (b), , 5, , (b), (d), , 20, , (iv) 0, (ii) arrayli, is, the, statement or, (c)What, expression at)», () i-1, i) arraylil, (ii) i+1, (iv) n, , 14, , complexity of the bubble sort algorithm is.., , (a) Ofn), (c) O(n2), , (b) Ologn), (d) On logn), , 52. The, , (d) What is the statement, , given array is arr {1,2,4,3). Bubble sorti, being used to sort the array elements. How, =, , () arrlj+1], , many, , iterations will, , be done to sort the, array with, , improvised version?, , (d) 0, , 53. How, many passes does, , a, , Bubble, , require for sorting a given list of n, , (a) n*2, , sort, , algorithm, , items?, , (b) n1, (d) n-1, , ()n+1, , (iv) arrayli, or, expression at 3, ) array[i+1], (i) j-1, (ii)j, (iv) arrayl, The following, program code sorts a sr=, dimensional array in, ascending order u, Selection Sort, , 55., , in the code, to, , Programming based questions, , be, , technique. There are some pi, marked as ?1?, ?2?,?3?, 24?, , replaced by, , a, , the code works, , 54. The, , following program code sorts, single, dimensional array in, order using, ascending, Insertion Sort, technique. There are some places in, the code, a, , and 2, , statement/expression so, , correctly., voidsort(int ?1?), intn =?2?;, , ?1?, ?2?, ?3?, ?4? and ?5?, which, , are to be, replaced by, that the code works, , voidsort(intarr[]), , expression at 2n, (ii) key, , (i) arrayl, , an, , (b) 2, , () 1, , as, , or, , (e) What is the statement, , (a) 4, , marked, , expression a, , (i) arraylj+1i, , (i) arrlil, , (c) 45, , pression at, , (ii) arraylength, , () arr.length, , keys can be created?, , 51. The, , What is, , (a), , a, , statement/expression, , correctly., , so, , One by, , one move, , subarray, , boundary of un, , for(int i =0; i< n-1; i++), , int n =?1?;, , Find the, minimum, , for(int i =1; i<n; +ti) {, , array, , int key = ?2?, , element in, , int ?3?-i;, , intj =?3?;, , for(int j i+1;, j<n;j++), if(24? <arr{min_idx]), min_idx =j, =, , * Move elements of, arr|0..i-1], that, , are, , greater than key, to one position ahead, of their current, , position, , /, , whilej=O&&arrlj] > key) {, , Swap the found, first, , ll element, , t, , minimum eleme, , with, t
Page 32 :
Implementation of algorithms to solve problems | 291, inttemp =?5?;, arr/min_, idx=arr/il;, , if (21?), , arrli= temp;, , pi is partitioning index, arrlpi] is now, s the statement or expression at ?1?, , What, , ), , at right place, , is the, , (a), , ii) array.length, , arl], , 22- partition(arr, low, high);, quickSort(arr, low, ?3?); / Before pt, , (iv) -1, , (ii) length, , ?5?(arr, 24?, high); // After pi, , What is thesstatement or expression at ?2?, ), , i) arrayljt1, , arr.length, , (iv) 0, , (ii) arrayli], , (a), , What is thesstatement or expression at ?3?, (i) min_idx, , (ii) i+1, , is the, d) What, , (ii) arrayli), What is the, , e), , ), , i) arrayljl, (iv) n, , (ii) length, , expression, , (b), , at ?4?, , statement or, , (c), , -, , iv) arrayli], sort technique., as, a, , ?1?, 22?, 232,, , (iv) n, , (ii) i+1, code is, , the, , (d), , quick, , What is the, , statement o r, , (e), , statement/expression, , What is the, , at ?4?, , (iv) array[, , (ii) arraylil, , to be replaced by, ?4? and ?5? Are, the code works, so that, , expression, , (i) pi+1, , (i) mid -1, , marked, in the code, , places, , Some, , using, , ?3?, expression at, , (i) pi 1, , (i) arrfmin_idx], , following program, 56. The, , at ?2?, , Gi) pi, , s t a t e m e n t or, , i ) mid+1, , arrayli+1], , expression, , (iv), , (ti) arraylil, , expression at ?5?, , at ?1?, , i ) low < high, , statement or, , What is the, , What is the, , expression, , (iv) -1, , i) arr(mid], , (i) key, (iv) array[i, , ) arrli], , last, , i) first +, , statement or, , statement or, , What is the, , s t a t e m e n t or, , expression, , at ?5?, , (1i) quickSort, , i) array[i+1], , properly., , (iv) arrayli, , (ii) j, , quickSort(arr[], low, high), AnswersS, 4., , Explanation:, an element, Worst c a s e, , Binary, , from the, , is, , Search, ordered, , Complexity, , time, , a, , set, , process, , of, , elements., , of binary, , Begin, , finding, The, , search, , 5., , is, , Olog 2 n)., 2., , (d) All of the, Explanation:, , where, , above, , It is, , a, , type, , of data, , data, of the, he, , arrangement, , he, , data, , are, elements, , is directly, As the, elements., , he, , structure, , follows a, , trend, , linear, , such, , that, , linearly, arranged, and, its previous, linked to, , tne e l e m e n t, , stored, , are, single-level, , the, , unearly,, storage of data., , answer., , (b), , tree., , heap is, Explanation: A binary, structure, , a, , An, , local,, or, , heap, binary, , data, , tree., of a, that takes the form, of implementing, are a c o m m o n way, , Binary heaps, , priority queues., , expression, Explanation: Theta notation of, is to drop low order terms and ignore leading, an, , that always, S. (b) Greedy Algorithm, algorithm, , Dest immediate,, , refers, order simply, Non increasing, Explanation:, where subsequent, of sorting things, item., to the idea, to the previous, than, o r equal, items are less, binary, that it is still a complete, To make s u r e, , 7. (a) Base case, , structure, , Xplanation:, , 6., , 1, (c) 9,8,6,3,3,, , elements, , suPports, , next, , a sorted array, Search: Search, , Binary, in half., search interval, dividing the, repeatedly, by, the whole array., interval covering, with an, Explanation:, , Multiple choice questions, , 1. (d) Ofn), , Search, (a) Binary, , while, , solution, , takes, , the, , finding a n, , constants
Page 33 :
292 | ISC, 8., 9., , 10., , CHAPTERWISE, , McQs, , (d) None of the, above, (d) both A & B, (6) It undertakes, all, , (Computer Science), operations, , to be, , dynamiC, , Explanation: The worst case occurs in the, Search, Linea, Algorithm when the item to be searched, is, in end of, the, , 20. (c) stacks, 21. (b) FlFO, 22., , Queue:, , element that goes first, , will be the first, To work with, FIFO, you have to call, from queue module., 14., , For, , this, the, , to come, , 23. (a), , array into, , for the two, , Polish notation, , is, , a, , expressing arithmetic, logic, equations. Its most, basic, , operators, , two, , algebraic, , distinguishing, , feature, , placed on the left of their, operator has a defined fixed, , operands, the syntax does not, parenthesis to lessen ambiguity.require, , (c) sorted list, , that, , can, , a, , be, , A, , sorted list is, , combination of an, hash table. It, contains a list of items, , accessed using, , a, , key an index. If, you access items, an, using, it is an, index,, and if you access, Array List,, items using a, key, it is a Hash, table. The collection of, items is, a, , or, , always, , the key value., , 17. (a), , parent nodes, to their child, , Explanation:, , A, , have values, , min-heap, , that. the data contained, (orequal to) the data in, , in, , 1s, , sorted by, , more than or, a, , binary, , processing, , a, , node more, , Explanation: Breadth-first search is, , for, , to, , searching, , ree sucn, , each node is less, than, that, children. the, binary tree is complete., , nodes, , 18. (c) recursive, , Explanation: A recursive algorithm is, algorithm which calls itself with «smaller, , an, , (or, , simpler)» input values, and which obtains the, result for the current input by applying, simple, , explores, , moving on, , 25. (d) stack, 26., , a, , tree data, , 28., 29., , next, , (c) Both Stack &&, Queue, , (d) All of the above, 30. (c), Binary Search Tree, 31. (a), node.next, , inaccessible, , 32., , (c), , 33., , 37., , (b), (a), (a), (b), (b), , 38., , (a), , 34., 36., , blanks, , Post-order Traveller, , linear search, linear search, , complete binary tree, , pivot element, , selection sort, Selection Sort, 39 ) resource, allocation, 40. (d), None of the, above, 41. (c), Execute, infinitely., Match the, , followina, , 42., 43., , (c) 1-ii),, 2-(), 3-i), (b) 1-(ii),, , 2-(ii), 3-(0), , a, , algari., , node, , It starts at, the tree, , all nodes at the, present, to the nodes at, the, , (b) False, , Fill in the, , an, , structure for, , 27. (c) Recursion, , 35., , equal, , than oncee, u, , 24. (a) queue, , notation form, and, , avoid, , and, , brackets or, , Explanation:, , Traversal (, Depth First Traver, , satisfies a given, property., , If the, , array and, , graph, , First, , is similar to, , Boolean visited array., , merge(), , operands., , number of, 16., , are, , a, , tree., , To, , halves, and then, , sorted halves. The, function is used for, merging two halves., 15. (d) Polish, Notation, , is that, , umber ot node, , The only catch here is,, unlike trees, ees, gre;, contain, may, cycles, a node may be visited, t, a, , trees, , two, , Explanation:, for, , 1, , leue, , for, , a, , merges the, , -, , que, Explanation: Depth, , out., , Explanation: Merge Sort is Divide and, ConquerT, algorithm. It divides the input, halves, calls itself, , 2k+1, , Explanation:, , Queue() class, , (b) nn - 2, spanning, (b) Merge Sort, , (b), , The maximum, number, level T of a binary tree is 21-1, , Explanation: First in First out, , 13., , valuue or the stma, , 19. (a) sorted, , Array., , 12. (a) Queue, , returned, , input., , other factors, , 11. (d) O(n2), , to the, , r, , depth p, depth le
Page 34 :
mplementation of algorithms to solve problems, , 293, , 51. () O(2), H, , r, , a, , l, b, , a, , s, , c, , d, , ., , Explanation: BubbleSort is an easy-to-implement,, slable, , O(n°) in the average and, the best ca, , 8,7,9,22,5,13,31 (4 SWAPS), y p l a n a t i o n :, , ,N89.5,13,22,31(3S1WAPS), RI78.5,9,1,, , sorting; algorithm, , a, , time, , complexity of, , worst, , cases, , and O(n) in, , with, , 52. (a) 4, , (TSWAPS), , Explanation: The given, , I17,5,89,1.,2231(1 SWAPS), , array is, , arr, , - 1, 2,, , 4, 3)., , elements., , Bubble sort is used to sort the array, done to sort the array?, How much iteration will be, the first two elements, Even, , 5,755,9, 3,22,3|(1 SWAI'S), , Explanation:, , 4.1tt-10, , are, , 25134, 2 and 5 are, , st pass,, , |, , nation: n, , already sorted,, , though, , iterations, bubble sort needs 4, , to sort the given array., , i p l a n a t i, , wnpared., W, , Sune, , No, , change in, , I, n, and, 5 a, ass, , M.alswap-, , 2145(1S, , TS-1),, , are, , that, , case, , 53. (d) n-1, thus, , compared, , swapped, , 2),, , ->:2153421354(TS, , Programming based questions, , 3), , 2-> I and 2 swapped, , ssi.e, , 12345 (TS54. (a) (i) arr.length, , >, , (b) 6) arlik, , itha, , (c) (i) i-1, , t.(, Explanation:, , pri, , 2^n, , n, -n where, , =, , umber of nodes, , (d) (i) arrlj+ 1}, (e) (i) arrayli+1], , 47. (c)4, 55., , 8.(0) 148, , (N, Explanation:, (OMPARISONS, , NO, , MIN, , 100, , OF, , (b) (i) arr.length, , (3N/2)-2, , (c) (i) min_idx, , (3X 100)/2-2 148), 49., , (a), , 0,10,110,11, , Explanation:, , (d) i) arlijl, , 10,1111, , The, , probability, , Huftman code, , are, , according, , tree is, to the, , unique., , nodes, , nodes,, , are, , given ás, , we c a n, , nunmber, , of, , distinct, , BST for, , So, for 4, ((2n)Cn)/(n+1), , have (8C4)/5, , <, (a) (i) low high, , (b) (i) pi, () (i) pi+, (d) (Gi) pi, , 30. (d) 14, Explanation: The, , (e) (ii) arrfmin_idx], , A,1/4,, 56., , 1/8,1/16, 1/32, So, the, , (a) (i) arrll, , =, , 14, , n, , distinct, , distinct BSTs., , 1, , 1, , (e) (ii) quickSort
Page 35 :
Chapter, , Programming in Ja, , 4, , term where if parents, 8. Name the, is also killed., child, , Multiple choice questions, 1., , Which is, , not OOPS, , concept, , (a) Inheritance, (c) Polymorphism, 2., , in, , object, (a) Aggregation, , Java?, , object?, (a) Aggregation, , overloading is determined?, , (a) At run time, , (b) At compile time, , () At coding time, , (d) At execution time, , than, , method with same name but, different method signature and different, number or type of, , 11. Which, , (b) More than, , one, , method with, , signature, same number of parameters but, , different type, (d), , a, , (a) Polymorphism, , (b) Encapsulation, , (c) Abstraction, , (d) Inheritance, , 6. The, , concept, , of, , Java, , which, , is achieved, , combining methods and attribute into a class, , (a) Encapsulation, (c) Polymorphism, , b) Composition, , ()Encapsulation, , (d) Association, , (b) println, , (c) Both (a) and (b), , (d) None of the abor, , so, , that, , Employee (0; Choe, an, object of the ce, (b) class, (d) new, , output for, , the code:, , (a) Shows error, , 14., , (b) Hello WNorld, (c) Hello World", (d) None of the above, What element, provides, , a, , common system resources., , (a) new, , by, , 7. An object which has its own lifecycle and there is, , inside the Svse, , System.out.println ("Hello World");, , 15. SDK is, also, , (a) devkit, (c) JDK, 16., , Feature, , of, , code in, , a, , standard intertl, , (b) API, (d) None of the abo, , (c) Systemn, , (d) Abstraction, , (a) Aggregation, , encapsulated, , (a) out, , () run, 13. What is the, , real, , (b) Inheritance, , no owner is called ?, , is, , Employee is created., (a) object, , signature, , concept of Java is used to convert, world objects in terms of class?, , object, , suitable word, , More than one method with same, name, same, number of parameters and, type but different, , 5. Which, , b) false, , 12. Employee emp =, , same name, same, , signature but different number of signature, (c) More than one method with same name, same, , polymorphis, , class?, , one, , parameters, , Combination of inheritance and, Method overriding?, (a) True, , Overloading does not occur when?, (a) More, , (b) Composition, (d) Association, , ()Encapsulation, 10., , life, patt, , object cannot belong to anothe, , and child, , ldentify the, (a) Compile time polymorphism, , (b) Execution time polymorphism, () Multiple polymorphism, (d) Multilevel polymorphism, , 4., , (b) Composition, (d) Association, , (c) Encapsulation, 9. What is it called where object has its own, , (b) Encapsulation, , (d) Compilation, type of polymorphism in Java?, , 3. At what time method, , obion . is k, , know, , as:, , (b) JVM, (d) None of the abol, , Java which, , safe and, , (a) Secure, (c) Dynamic, , is, , used, , to, , dynam, , callyl, , expedient manner:, , (b) Distributed, (d) Robust
Page 36 :
Programming in, , additional package is included by JDk:, , a, , )j, , a, , v, , a, , ., , a, , w, , 295, , |, , 28. String indexes begin with, , 1 7 ., W h i c h a d d i t i o n a, , (, , Java, , (b) 3, , (a)1, () 0, , t, , (b) sun.addtools.debug, , ) 2, , 29. Name the special operator to allocate memory, java.util, , (b) Old, , (a) New, , (d) sun.tools.debug, , (c), , not a feature of Java?, , (d), , +, , 1 8 .W h i c, , String, , 30., (a) Portable, , StringBuffer, , classes, , package:, (a) java.awt, (c) java.lang, , (b) Structured, , (), , and, , Distributed, , are, , defined in,, , (b) java.io, (d) java.util, , (d) High P e r f o r m a n c e, , Fill in the blanks, , chooses to execute the, , system that, , 19. J a v a r u n - t i m e :, , JAVA Bytecode:, (a) SDK, , (b) JDK, , (c) VM, , (d), , a, Method used to extract, , 31., , from a String:, , None of the above, , that a r e, 20, Operators, results:, and give the, , 32. Human, , Decrement, Increment and, , Being, , (c) Comparison, , (c) Part-Of, , the result of the, 21. What is, , (b), (a) Interface, , (d) 21, , (c) Package, , construct, , that is based, , programming, of nested if:, sequence, , Common, , (b), , (a) switch, , (d), , (c) if-else-if ladder, , (a) Friendly, , above, None of the, , (c) Protected, , branch, , (d), , 24., , Loop, even, , that always, , though, , the, , executes, , (c) while, 25. Which, , statement, , is used, , statement., , (d), , continue, , (d), , method, , which, , can, , be, , 37., , of the, , above, , the size, used to set, , returns, , the, , reversed, , (b) replace(), , (a) insert(), , (d) reverse(), , object, , specifiers., , (b), , 2, , (d) 4, , class to derive specific, is used as a base, , classes, , (b) friend class, , (a) private, , is:, which it is called, , (c) delete(), , Java supports, , of the s a m e kind., , loop?, , (d) setLength(), , () capacity(), , (d) super, access, , (c) 3, , (b) length(), , (a) ensureCapacity(), , that, , 36., , (c) abstract class, , on, , (d) superclass, , 38. Writing the same code in different places, leading, to unnecessary, , of the buffer:, , T h e method, , None, , inheritance:, , (b) catch, (c) extends, , (b) quit, , (c) break, State the, , a, , private, , Private, , used to prevent, , (a) 1, , do-while, , as, , (a) final, , true:, , from, to exit, , (d) Polymorphism, , keywords is, , 35., , at least once,, , (b), , (a) continue, , 40, , body, , is not, , condition, , (a) for, , its, , hierarchical, , Inheritance, , (d), , if-else-if ladder, , () break, , of, , been declared, member that has, 34. A class, class., will beL to its, (b) Public, , nestedif, , the Java's multi-way, (b) nested if, , (a) switch, , creation, , the, , classifications?, , (b) 47, , (c)7, , Identify, , (b) Is-A, , allows, , 33, , expression: 10+5*8-15/5, , 3, , 23., , of, , fall under., , Elephant, , (d) Has-A, , (d) Arithmetic, , a, , and, , the following relationship:, (a) Kind-Of, , upon, , (d) charAt(), , ()getBytes(), , (b) Logical, , 22., , (b) getChars(), , (a) toCharArray(), , used to compare two values, , (a), , single character, , replication of code is know, , as:, , (a) Code extensibility, , (b) Code redundancy, , (c)Codereusability, , (d) None of the above, , 39. The block which can be nested is:, (a) catch, , b) finally, , (c) try, , (d) None of the above
Page 37 :
Lsb, , 40., , ISC, , CHAPTERwISE, , MCQs, , (Computer Science)-, , Number of final blocks which, , are, , used, , exception-handler., , (a) 1, , (b), (d), , (c) 3, , 3-(iv), 4-(i), (a) 1-(i), 2-(i),, (b) 1-6i), 2-(i), 3-(ii), 4-(iv), 3-(iv), 4-(ii), () 1-), 2-(i),, (d) 1-(iv), 2-(i), 3-(ti), 4-(ii), , tor, , 2, , columns:, 44. Match the, , Match the following, , Group A, , 41., , Match the colunmns:, Group A, 1., , an, , object, , of, , Group B, , an, , i), , exception class as, , instance of, , Filter streams, , Data Input, , Stream |(i), , 4. OOPs is invented, , catch, , 3. In Unicode, , (a) 1-i), 2-(ii), 3-(iv), 4-(i), b) 1-4i), 2-6), 3-6iv), 4-(ii), (c) 1-4iv), 2-6), 3-(i), 4-(ii), , (ii) Random Access, , characteris, , File, , represented by, To, , (b), (c), (d), , perform 1/0, (iv), operations, 1-Gi), 2-(i), 3-6), 4-iv), 1-ii), 2-iv), 3-6), 4-6i), 1-i), 2-6), 3-(iv), 4-(6ii), 1-6), 2-(iv), 3-(ii), 4-(i), , 42. Match the, , 1-6v), 2-(ii), 3-(i), 4-(), , 16 bits, , 45. Match the columns:, , Group A, 1. OOP boost the, , code reusability, 2., , i), , skip(, , by, , 4., , Input Stream class, , (ii), , method is, , Output Stream, , (a), (b), (), (d), , immediately (iv) java.awt package, , after the init() is, , (a) 1-i), 2-(ii), 3-(i), 4-(iv), , Java?, , (c)1-(ii), 2-6i), 3-(ii),4-(iv), , (6) Classname, obj, , 43. Match the columns:, , (c), , Group B, , ), , extends, , 2. inherit a class, , (ii), , Class, , 3., , (ii), , Access Modifiers, , private member of, , a class is accessible |, 4., , private, public &, protected are, , syntax is used to create an object Clas, ot, , (a) Classname, obj= new(), , (d) 1-iv), 2-6i), 3-6), 4-(ii), , abstract data type, , Sun Microsyste, , 1-), 2-(i), 3-(i), 4-(iv), 1-(ti), 2-(ii), 3-6i), 4-(iv), 1-i), 2-6), 3-(6v), 4-(ii), 1-6), 2-iü), 3-(iv), 4-(ii), , 46. Which, , (b) 1-ii), 2-6), 3-(iv), 4-(ii), , Group A, , (iv), , Programming based questions, , called, , 1., , one of the, , inventors of Java, , Graphics class isa (ii) start(), part of, called, , Inheritance, , 3. Java is developed |(ii) James, Gosling, , hierarchy, , 4., , (ii), , handling, , Group B, , the output class, , 3., , Exceptions, , common class, , columns:, , Group B, , (), , for exception, , Group A, 1. foundation for, , 2., , (iv) False, , by, , Stream classes, , (a), , (ii) Alan Kay, , return a value, , and Data Output, , 4., , body, , 3. Constructorcan, , a parameter., , 2., , GroupB, Abstract dlas, have, , 1. Abstract Method ), 2. We can't create an |(1i) doesn', doesn't, , (iv) only members of, the same class, , 47., , Classname obj, , =, , new, , =, , new, , Classnamel), , Classname, Classnamel), , (d) None of the above, Choose the correct, statement, syntax to create an, , Classname obj, How, , to, , create, , =, , object of Class in Jav, , new, , Classname(), , Abstract class?, (a) Creating at, least one, pure virtual function member fur, an, , function *
Page 38 :
|, , Programming in Java, at least, 'reating, , (b), , one member function, , as a, , (6) Object can be created only with one parameter, , virtual function, , (c) Object can be created with more than one, cla, bstract, as A, Abstract, class using virtual, , as, , parameter, , Declaring, , c, , k, , e, , y, , w, , o, , r, , d, , as, , Ab, Abstract, , as, , ), , 297, , Declaring, , class, , using static, , (d) Objects can be create only without parameter, 51. Choose correct option for the code ., , class A static int c-0; public: A()l c++;}};, , keyword, , Pick, , the, , correct, , syntax, , for class ?, , make c-1 for each, , object, , Constructor will make c-0 for each, , object, , (a) Constructor will, created, , classA, , (b), , created, , int a,b;, , public: void disp();, , (c), , Constructor, , will, , keep, , number of, , will, , just, , initialize, , objects, , created, , (a), , (d), , void disp::A(){ }, , then, , c-0, , increment by 1, , (b) void A:disp(01}, , 52., , {cout<a«<b;}, , ) void A:disp(), cout<<a«<b; }, (d) void disp:A(0{, the, 49. Select, , Constructor, , correct statement for, , Identify the data member in following, will be used when, , an, , code which, , object is created?, , Class A, , the given code?, int x; int y; int z;, , class student, , public: A(0, private: student(), , y-100; x=100*y;, , public: student( int x), marks =X;, , (a), , x, , will be used, , (c), , z, , will be used, , (b), (d), , used, y will be, All will be used, , most, member considered, 53. Select the, , secure, , in the, , code?, be created, , object can n e v e r, without parameters, be created, 6) The object c a n, can be, with only 1 parameter, the, object, () Only, , (a), , The, , created, , (d) Only, , the, , object, , with, , some, , parameters, , can, , class A(), int a, , private:intb;, , be, , protected: int c;, public: int d;, , Created, 0., , The true, , statement, , is:, for the code, , lass A, private: int marks;, , (a) a, , (b, , b, , ()c, , (d), , d, , 54. Choose the, , char name[20];, , correct, , option, , class A, , public, , A(int x=100), , private: A(), , marks=xX, , O b j e c t s can, , be, , created, , Without parameteer, , with, , one, , parameter, , or, , public: A(int x), , tor the, , given code?
Page 39 :
298, , |, , iSc, , CHAPTERWISE, , MCQs, , (Computer Science)- X, , (i) System.out.println, (iii) public, , Aa, , (iv) static void main(), , A b(100);, , (a), (b), (c), , (d), , rding the program«code, , 56., , Program will give compile time error, Program will run fine, Program will give runtime error, Program will give logical error, , the questions that follow:, , / filename Test.java, , classTest, public static void, , 55. About, the, , program code, questions that follow: given below, answer, , sum, , =, , num1, , main(Stringl] args)|, =, , +, , num2;, , (a) What will be the, output?, i) Sum of these, numbers:, (ii) Sum of these, (v), (b) What, , break;, , num2 15, sum;, , System.out.println("Sum, , of these, Sum of these, , of, , these, , (a) What will be the output?, i) Compiler Error, (i) syntax error, ii) run time error, , iv) logic error, b) What is the name of the, class?, i) System.out.println, (ii) static void, , 20, , numbers: 40, numbers: 60, numbers: 80, , is the name, of the, , (i) AddTwoNumbers, , Answers, constructor and also, different number of when, , 1. (d) Compilation, , The OOPs, , in Java, abstraction, encapsulation,Concepts, inheritance,, 2., , polymorphism., , (a), , Java,, , If you, it is the, , polymorphism., 3., , (b), , At, , compile, , overload, , example, , 5. (c) Abstraction, , Explanation:, , in, a, , of, , java, , not, , static method, compile time, , abstract, , applicable, , it is also, , time polymorphism., , (d) More than one method, , parameters, , is, , than one method with same name but different, , classes, methods, achieve abstroacth, pillar of Object Or, , rient:", , Explanation: Encapsulation, , determined at, as, compile, , signature, Explanation: Overloading occurs when more, , non-access modit, , a, , It is used, to, one of, the, , Programming(OOP)., , of, , known, , with same name, same, and type but different, , is, , for, , variables., , which is, , 6. (a) Encapsulation, , Explanation: Overloading, number of, , signature, , and, , time, , compile time. Hence,, 4., , are, , same, , parameters and/or paran, , type., , Compile time polymorphism, , Explanation:, in, , main(), , (ii) public, iv) Test), , class?, , Multiple choice questions, Explanation:, , args), , System.out.println("Hello");, , numbers: "+sum);, , (ii) Sum, , main(St, , for(inti =0; 1; it+){, , the, , public class AddTwoNumbers, public static void, int numl, =5,, , given below, , 7., , in Javais an, wrapping the data and code, together single unit., acting o, (d) Association, , charni", , as a, , Explanation: Association in, , or, , relation between, , set up, two, their, 8. (b) Composition, , through, , Java, , separate, , objects., , is, , a, , co that, irate classes, clas>
Page 40 :
Programming in, , Explanation: A, , elationship between one class, Other cla, classes cannot exist without, , object, , a, , stop there,, to, control returns from the loop immediately, first statement after the loop., , two, , within, , with each other exists when, , ects associatea, , there i s, , ition in Java between, , comp, , the, , loop,, , a, , iterations, , loop, , ther., , 26. (a) ensureCapacity( ), , or, , parent, , owner, , ( a ) A g g r e g a t i o n, , Aggregation, , in, , lanation:, , Java, , is, , relationship, , a, , aggregate class contains, two classes.The, class and is said to have, to another, , method of, , Syntax:, , reference, , Ownership, , 0, , class., of that, , minCapacity), ensureCapacity(int, , public void, 27. (d) reverse(), , (a) True, , lang., Explanation: TheJava., , 1 1( a ) o u t, , is, , method which, an inbuilt, , 12. (d) n e w, , characters, , 15.(b), , Hello, , this, , 28. (c) 0, , (d) sun.tools.debug, , of, , string, , a, , Portable,, Java is fast,, Explanation:, reliable, and, ,secure,, , High, , would, , Performance, , would, , if-else-if, , Java, , decide among, , multiple, , from the, , executed, , top, , The, , down., , execution, , to dispatch, , the, , is, , multi-, , a, , to, , be byte,, , 24. (b) do-while, , short,, , do-while, , loop, , for the, , new, , until, , the, , iterate, , specified, , iteration, , program, , number, , true., , If the, , least once,, , of, the, , allocated., , recommended, , to, , use, , a, , classes, , are, , hierarchy,, , provides, java.lang, to the design, , object,, , and class, , run, , which, , time., , 1s, , a, , (a) Kind-Of, , 33., , (b), , Inheritance, , 36., , (c) 3, , Statement, , Break, , loop. As, , 37., , (), , abstract class, , from, from, , 38., , (b), , Code, , loop, the., , terminate, , Explanation:, , used, , to, , encountered, , encountered, , is, statement, , break, , 31. (d) charAt(), , 35. (a) final, control, , the, , blanks, , 32., , The, , run, , time, , given type, , which, , returns, , This operator, , classes, , that, , the, , Java, , of, , redundancy, , most, , is the, , instances, ,, , 34. (d) Private, , loop., statement that is, , Fill in the, , loop a t, , hile, do-whil, , a, , at, , operator., , not, , it is, , 25. (c) break, , S0on as, , is, , execute, , h a v e to, must, , and you, , a, , of, , in JAVA, , language., , classes at, , repeatedly,, , UXed, , the next, 00:30 and, , variable, , programming, , and int, , char,, , used to, , is, , Explanation:, , is, , 0,, , allocate memory, , are, , code, , primitive data types., , condition, , of, , fundamental, , Basically,, expression., , can, , expression, , part of the, , that, , of the space, , Explanation:, , easy way, , It provides, of, d i f f e r e n t parts, , of the, , value, can, , the, , individual, , character, , operator, , special, , a, , address, , 30. (c) java.lang, , an, , branch, , on, , the, , switch, , statement., , using, , You, , heap, , statements, , is called, , statement, , Explanation:, , based, , The if, , the, , to, , used, , is, , ladder, , options., , 23. (a) switch, , way, , be 1,, , within, , ladder, , Explanation:, , the, , and so on., , Explanation:, , 21. (b) 47, if-else-if, , index, , an, , of, , characters, , first, , the very, , have, , sequences, , ordered, , 29. (a) New, , 20. (c) Comparison, , are, , the, , by, , directly using, zeroin Java is, String indexing, in the string, , index., , so, , based,, , 19. (c) JVM, , (), , replaced, , causes, , accessed, , be, , can, , Structured, , numerical, , are, , 00:15 and, , data,, , character, , Distributed,, , 22., , Strings, , Explanation:, , 16. (c) Dynamic, , (b), , The method, , the, , reverse of the sequence., , 15. (a) d e v k i t, , 18., , reverse, , to, , is used, , to be, , character sequence, , reverse(), , StringBuffer., , in the StringBuffer., , World, , 14. ( ) System, , 17., , the, , Explanation: The ensureCapacity(), of, increases the capacity, java.util.ArrayList class, ensure, to, if necessary,, this ArrayList instance,, elements, of, least the number, that it can hold at, argument., minimum capacity, specified by the, , class., , the, , between, , and, , strong, , a n da n o t h e r, , a, , 299, , Java|, , of, , root, , important, , of the, , class, , which represent
Page 41 :
T, , 1SC CHAPTERWISE MCQs (Computer Science)-A"_, , 39. (c) try, , 49., , (c) Only, , the, , object with only, ly, , 40. (a) 1, 50., , Match the following, , (a) Objects, , can be, , created with, , th one parame, , without parameter, , 51. (c) Constructor will, , 41., 42., , 43., 44., 45., , (c) 1-(ii), 2-(6), 3-(iv),, (b) 1-i), 2-6), 3-(iv),, (a) 1-(i), 2-(1), 3-iv),, (c) 1-(iv), 2-(6), 3-i),, (d) 1-i), 2-(i), 3-iv),, , 4-(ii), 4-(ii), 4-(ii), 4-(i), 4-(ii), , 47., , (c) Classname obj new, Classname();, (a) Creating at least one member function, , 52., , (c), , z, , number, , mber of, , will be used, , 53. (b) b, 54. (a) Program will give compile time er, 55. (a) (i) Sum of these numbers: 20, , TrOr, , (b) (i) AddTwoNumbers, 56. (a) (i) Compiler Error, , =, , pure virtual function, 48., , keep, , created, , Programming based questions, 46., , 1 parameter, , created, , (b), , void A::disp(0{), , Explanation: There is a mistake in c, as a, , check, , expression, , use valid., , (b) (iv) Test(), , ot tor, , loop. instead of
Page 42 :
Chapter, , Objects, , 5, , that describe the, , Attributes, , 10., anltiple c h o i c e q u e s t i o n s, , object is:, , (b), , method, , (d), , name, , (a) Information, , ariables, member, , its, , often called, , (c) data, , its, , to as its, functions are referred, , Member, , and, , are, , (b), , (a) a t t r i b u t e s , m e t h o d s, , of these, , (b), , none, , (d), , data, activities, , (a) Components, , near, , (a), , and, , specifiers, , (b) opened, (d) private and public, , row, , data from, , protects, , Use 0f, , which, , System, , 12., , and closed, , far, , table and, , (c), , access, , (d) Member, , abstractly, , access, , (b) private, (), (d), , none, , (b), , have, , be, , same, , be, , considered, , identify, , use, , to distinguish,, , name, , Name, , (d), , Behavior, , () object, 14. What is, , a, , class for, , member, , multiple objects, , of, the value, , with similar, , features called?, , attribute, , used, , ?, , (a) Image, , representation, , (d) guide, , (c) template, , (b) Objects, , the, , blueprint, , as a, , (b) class, , 15. What, , (d) Identity, , c) Procedure, , things, , does, , class, , a, , describe, , with, , a, , group, , ot, , behaviour?, , common, , object and, , (b), , attribute, , associated?, , behavior, , is always, , (a) Features, , (d) States, , (b) Objects, , (a) Personality, , (c)values, , (d) Identity, , 16. Which, , c) Procedure, , of objects, , (c) Process, of object, , can, , (a) State, , (d), , Procedure, , be change, , (b), , Method, , (d), , Class, , due, , to its, , (c) objects, 17. Name the concept, , is called, , (identity), , What it, , (b), , state), What it is (its, , )What it does, , (d) All of these, , (its, , features, , class, , can, , share, , behavior), , 18. What, , represent, , members, , embody all the, particular set of objects?, , which is used to, , of, , a, , (b) class, , (a) Method, , (d) members, , () object, , (c) Status, 9., To describe an object, , (a), , same, , (a) Methods, , common, , behavior?, , in the, , (b) classes, , (b) Technique, (d), , element, , common semantic purpose?, , ?, is called, , (a) Method, , Toperty, , can, , for various objects?, , (b), , (a) Personality, , .Behavior, , which, , (b), , can w e, , By whom, , Element, , (d), , (c) Birth date, , b., , All of these, , (d), , Data o r i e n t e d, , ( a ) Method, , (a) Colour, , 5. How, , 13., , @, operator,, , attribute c a n, , people, , When two, , Value oriented, , function, , of these, , other, 4. Which, , are, , values, , (a) Object o r i e n t e d, , specifier, , class protection, , that, , express, , of their attributes?, , inadvertent, , (c), member, , that, , of class, , the set of objects, in the, differing only, equivalent, , to, , enables, , the concept, , uses, , m o d i f i c a t i o n s ., , (a) protect(), , methods, , Associate, , (c) Part, , (c) v a l u e s , m o r a l s, , 2, , behaviour, , attributes, 11. Data, collectively is called, , i n a class., , Keywords that are, , and, , a, , collection of classes ,constraints, , and relationship among classes?, , (a) Diagram, (c) drawing, , (b) map, (d) figure
Page 43 :
302|, ., , IsC, , CHAPTERWISE, , MCQs, , (Computer Science, , XII, , Howdo we model the static view of an application?, , (a) Diagram, (c) drawing, 20., , What do, , we, , Name the, (a) Int, , memory, , Room r2=, , object, , (d) real, that, operator, allocates the, an, object and returns the address memory for, of the, later use?, object tor, , (a) heap, (c) stack, 25. When an, , (b) Pile, (d) all of these, object is created a, special method is, executed to perform initial, task what it is, called?, (a) Function, (b) constructor, (c) class, (d) method, Which of the, is, correct when an, is created of following, object, type Room, and, , variable rl, , ();, , variables., , (a) types, , (b) rl=room () new;, (d) None of these, , parentheses without arguments?, (a) Function, , are, , individual objects and, , 33. Every, , () operator, 34., , allocated different memory, spa, , (a) classes, ), , 35. When, , claimed back, (a) classes, , (d) class, , n0 more, , to reuse., , 36. In, , creating an object, instantiation., (a) class, (c) inheritance, , 37. An, -, , memory to, , (d) objects, is, , (d) polymorphism, object is created by alloa, store data for the, for an, , object., , (6) example, , (c)illustration, object that, , belongs, instance of that, class, (a) cells, , of the, , (d) none of these, to a., is said n, , (b) variables, , (c) memory, 39. And, , that, , 40., , (d) class, , 1s an, , where, , also called, , (b) object, , (a) instance, , an, , needed the memor, , (b) variables, , (c) operators, , (a) instance, (c) memory, , (c) Parentheses, , (d) objects, , are, , (d) method, , (b) brackets, , (b) variables, , operators, , actual object., , (a) Room, , (b) data, (d) variables, , hold their data values., , 38. An, , arguments, , class,, , has its own set of data., (b) variable, (d) object, , (a) class, , (c) class, , following, , not in the, , (c) collection, , (b) constructor, , determine the initial values of variables?, , is contained inside, , (a) information, , (a) Function, , contain, , (d) set, , 32. The actual, , empty, , (b) constructor, , c)class, (d) method, What initialises the attributes, (variables), object using default values?, , (b) collection, , (c) location, , assign its address to a, , (c) RL= class room ();, by default created, when there, , 27. What is, , 29. Which of the, , these, , 31. The class determines only the, , Identify, , (b) Float, (c) new, (d) real, 23. The, memory location where the, object is stored is, known as?, (a) Memory, (b) variable, (c) reference, (d) none of these, 24. Name the, special portion of memory where, the, objects live?, , 28., , none of, , (d) indication, b) float, , room, , (b)variable, , (d), , Fill in the blanks, , keyword that is used to create an, , (a) rl=new, , variable R2, , (c) reference, , (a) Int, , 26., , Room, , new, , (a) Memory, , oft Clas», , are, , (b) position, , ()new, 22., , Choose the correct address of, , where only object is created for-s, , (b) map, (d) figure, call the variable, which, , type?, (a) Orientation, (c) reference, 21., , 30., , as an, , (a) cells, (c) memory, , of, , a, , class, , is, , ord tor, another wor, , (b) example, (d) none of these, , abstract, o, instance isrepresentation, its concrete, rep, , an, , T e t e representat, , (b) variables, (d) class
Page 44 :
Objects| 303, , 44. Match the columns, h, , the following, , Group B, , Group A, (i), , class, , (ii), , static, , Declare class, , Match the columns:, , Variable, , Group B, , Group A, , (1), , Instance a n d, , Attributes and, , methods, , methods, , 3., , Objcct, , (i), , To d e t i n e a n, , OOP, , Passed by value, , 4. Defined using, , object's belhavior, , 3, , (ii) heap, , object, , Instanceallocated, , (iv), , new, , 3-(iv), 4-(ii), , (a) 1-ii), 2-(i), 3-(iv), 4-(ii), 4-(ii), (b) 1-(i), 2-(i), 3-(iv),, 4-iv), (c) 1-(ii), 2-(i), 3-(i),, , Group B, , Group A, , 3-(iv), 4-(ii), 1-6), 2-i),, , 1., , 2-(i), 3-(ii), 4-(iv), ) 1-(i),, 2-(iv), 3-6i), 4-(ii), d) 1-(),, , overloaded, , (i), , Called without, , methods, , creating instance, , More than, , 2., , one, , (ii), , class method, , (ii), , class, , (iv), , Constructor, , method having, , columns:, , Group B, , Group A, 1., , parameters, , 45. Match the columns:, , (a)1-i),2-(i),, , Match the, , (iv), , 4-(ii), (d) 1-(ii), 2-(iv), 3-ti),, , in memory, , 2, , methods, , static keyword, , Keyword for, , (b), , (ii), , (i), , Object Oriented, , object, , same namne, , 3., , Invoked, , automatically, Programming, , i ) data, , 2 Unique entity, , (ii), , 3. Combining data, , 4., , methods are, , global, , inheritance, , 4-(i), , and methods, (iv), , encapsulation, , 4. Class acquires, properties from, , 3-(iv),, (a) 1-(i), 2-i),, 3-(iv), 4-(6i), (b) 1-6i), 2-(ii),, 3-(i), 4-(iv), (c) 1-i), 2-i),, 4-(ii), 1-(), 2-iv), 3-(i),, , (d), , another class, , Programming based questions, , 3-(iv), 4-(ii), (a) 1-(ii), 2-(i),, , 4-(ii), , (b) 1-64), 2-(i), 3-iv),, 4-6iv), (c) 1-(i), 2-(i), 3-(ii),, , the, 46. What is, , (a), , 4-(ii), (d) 1-i), 2-v), 3-(i),, , (b), , 43. Match the columns:, , Group A, 1. Blue print, , Group B, instantiating a, , (i), class, , of, , constructor, , File, , Output, , Streamn, , exception, File not found, bounds exception, File out of, , (c) File, , (d), , use, , found exception, , None of these, , created trom the tollowing, instance will be, 47. Which, File Output, new, FileOutputStreamtosobject=, , 2., , Creating, a class, , objects of, , Restrictingthefree, flow of data, , (11), , fundamental, , (ii), (iv), , 4., , class, , Object, , concept OOPS, encapsulation, , Stream ("/home/Akash/myfile.txt");, , stream, (a) File output, , (c), , File reader, , 48. What, , screen, , stream, (b) File input, (d), , is the subclass of, , generally, , used to read, , 4-(i1i), a) 1-i), 2-i), 3-(iv),, , (a) File input stream, , 4-(1i), b) 1-6),2-ii), 3-(iv),, , (b) File reader screen, , (9 1-i), 2-(i), 3-(Gi), 4-(iv), (d) 1-i), 2-(iv), 3-(i), 4-(i), , (c) File writer screen, , (d) File output stream, , File constructor, , input, , byte data, , stream, , and is, , from the file.
Page 45 :
304, 49., , 50., , |, , ISC, , CHAPTERWISE, , MCQs, , (Computer Science-, , Xl, , Name the, method of file, input stream class, reserve byte of, data from this, input streanm., (a) Void elose, (), , Main obj= new Main);, , that, , System.out.println("The name is, name), , (b) Int read (byle || b), , ()Intread(), , (c) Void write(), the method of, file input stream class, that closes the, file input stream, and releases any, , Identity, , (a) What is the, , system resources associated, , with the stream, (b) Int read (byte || b), , (a) Void close(), , ()Intread), 51., , State the method, of file, reads up to, , i) Constructor, , (d) Void write(), , (ii) Main(), (ii) Stringl] args, , following, interaction through, keyboard/, take input as, command line, C) class, , belongs, , (c) scanner, 54. What is, default, , (a) Delimiter, , to, , the, , program, , (ii) Stringll args, iv) Name, , Concerning, answer, , the, , the, , program, , code, , questions that follow:, , given, , class Helper, , Java.util package?, , (b) console, (d) keyboard, , delimiter?, (6) printer, , ()console, , this, , (ii) Main(), , GUI for it may, , (b) code, (d) method, , in, , (i) Constructor, , 57., , (a) Program, , (a) Printer, , (b) What is variable, , arguments or from, , the files., , 53. Which class, , (iv) Name, , (d) Void write(), can get, input from live, , Which of the, , the, e conct., constructor, , above program, , input stream class that, b.length bytes of data from this, inputstream into an array of bytes, (a) Void close(), (b) Int read (byte |] b), (c) Int read), , 52., , name of, , (d) white space, can be of, different type for, Like "India 1947", example a string, can also be, read, , private int data;, , private Helper(), , data 5;, , 55. What, , as a, , values, , (a) Symbol, (c) word, 56., , Concerning, answer the, , class Main, , "string int", , public class Test, , (b) Token, (d) mark, , public static void, , the, , program code given below,, questions that, follow:, , main(Stringl args, , Helper help =new, Helper();, , System.out.println(help.data);, , private String name;, // constructor, , Main(), , System.out.println("Constructor Called:");, , name = "Programiz";, , public static void main(String|| args), , (a) What is the, output of the, ) Compilation error, Gi) 5, , (ii) Runtime error, (iv) None of the, above, (6) What is the, name of, above program, ) Constructor, , /constructor is invoked while, , /creating an object of the Main class, , (i) Helper), , (iil) Stringll args, (iv) Name, , following, , the, , constr, , ro, , uctor.
Page 46 :
Objects| 305, , neruine, , program, , the P, , code given, , below,, , public class Test, , t h a t follow:, , fol., , questions, , t, , h, , public static void main(String|| args), , e, , lemp, Temp obj Temp.create(20);, , 7ivate lemp(intdata), , obj.myMethod(;, , Constructor called ");, , Syste, m, m., .o u t . p r i n t ( ", , (a) What is the output of the following program?, method called, i) Constructor called, , protectedstatic 7Temp create(int data), , ed static, , (ii) Compilation error, newTemp(data);, , obj, Temp, , =, , (ii) Runtime error, , (iv) None of the above, , returnobj;, , (b), , publicvoid m y M e t h o d ( ), , What is the, , name, , created?, of the class object, , i) test, Method, , called, , (i) obj, , :, , System.out.print(", , (ii) String[l args, , (iv) Temp, Answers, Explanation:, , Programming, , itple choice q u e s t i o n s, , A, a, , atributes,, , Eiplanation:, , attribute, , An, , a, , is, , public, , another term, , constant, , for, , ili. It's typically, directly., be a c c e s s e d, arable that carn, collection of, code o r, of, block, to, method is a, together, of code grouped, Satements or a set, task, rtorm a certain, , or, , Um, , the child class of the, , er, , can, , be, , accessed, , ne package., rom, , Private, , same, , from, , members, , can, , be, , class, , Explanation:, , be, instance, , are, , constructor, , members declared, , hate, , Class, , Birth date, , Ooeds, , only, , in, , private, , which, , visible, , an, , in, , or, , object, , is, , methods, , accessible, , y, , declared, , class, , access, , as, , they, , in, , variables, , are, declared., , are, , enclosing, within the, , known, , 12., , (a) Object, , is, , heap,, , a, , is, , allocated, , instance, , created., , Java, , classes and, , 13. (b) class, , method,, , a, , slot for each, , an, , is, , object-oriented, , where every program, , programming language, class. Programs, at least one, , many, , outside, , oriented, , Explanation:, , of a class., , Instance, , block. When space, , any, , as, , variables, , java., , class, but, , a, , in the, , variable value, , private, , are, , Member, , for, , Rihed using5the, tne keyword private. The, 0ata, , data, variables, , modifier, , The, , these, , (c), , # outside package., , planatio, , (d) All of, , (d) Member, , pivate access specifierT, , by, , (a) Method, , 10., , class of, from child, accessed, , objects,, , methods., , 8. (a) State, , package., , non-child, , mbers, , 7., , 11., , cannot, , same, , object, , Public, , non-child, , many, , invoking, i n t e r a c t by, know,, is represented, It, State:, consists of:, , accessed, , package., , creates, , program, , entities., , 6. (b) Objects, , 9., , be, members cannot, , the real life, , attributes of an object., , operation., , i private and public, tiplanation: Private, , An, , represents, , of Object-Oriented, , as you, , a, , public, , or a, , basic unit, , a, , and, , typical Java, , which, , methods, , !, , It is, , objects,, , are, , which, , has, , often built from, are, , the, , instances
Page 47 :
306 |, , IsC, , CHAPTERWISE, , Explanation:, have, , A, , McQs, , class is, , common, , a, , (Computer Scienee, group of objects, It is, , XI, ch, , properties., template, blueprint from which, objects are created., a, , or, , 40. (d) Class, , Match the, , following, , 14. (c) template, 15. (6) attribute, , 41. (a) 1-i), 2-i), 3-(iv), 4-(i), , 16. (c) objects, , 42. (a) 1-(ii), 2-i), 3-(iv), 4-(ii), , 17. (b) class, , 43. (a) 1-(ii), 2-(i), 3-(iv), 4-(ii), , 18. (a) Diagram, , 19. (a) Diagram, , 44. (a) 1-(i), 2-(i), 3-(iv), 4-(ii), 45. (a) 1-(i), 2-(i), 3-(iv), 4-(ii), , 20. (c) reference, , Programming based questions, , 21. (c) new, 22. (c) new, , 46. (a) File not found exception, , 23. (c) reference, , 47. (a) File output stream, , 24. (a) heap, , 48. (d) File output stream, , 25. (b) constructor, , 49. (c) Int read(), , Explanation:, method, , A constructor in, Java is, that is used to initialize, , constructor is called when, created., 26., , (a) rl-new, , room, , ();, , 50. (a) Void close(), , special, The, objects. The, , an, , object, , of, , a, , a, , class is, , 51., , (b) Int read (byte [] b), , 52. (a) Program, , 53. (d) keyboard, 54. (d) white space, , 27. (b) constructor, , 55.(b), , 28. (b) constructor, , 56. (a) (ii) Main(), , 29. (c) Parentheses, , 30. (c) reference, , Fill in the blanks, , Token, , (b) (iv) Name, 57. (a) Gi) Compilation error, , (b) (i) Helper(), 58. (a) (i) Constructor called method called, , 31. (a) Types, , Explanation: When a constructor is marke, , 32. (b) Data, , private, the only way to create a new objectoi, class from some external class is using a, meh, , 33. (d) Object, , that creates, , 34. (d) Objects, , object, as defined abovein, program. The method creates () is respoms, , 35. (d) Objects, , for the creation of the, , 36. (b) Object, 37. (a) Instance, 38. (d) Class, 39., , (a) Instance, , a new, , Temp object from, other external class. Once the object is, method can be invoked from the class, the object is created., (b) (ii) obj, , 8, create, in
Page 48 :
Primitive values, Wrapper, Classes, Types and casting, , Chapter, , 6, , 11. If anything is to be, , Mutiple choice questions, , What will be that?, , (b) Integers, , (a) Real n u m b e r s, , execution?, , program, what will be required during, the computer., in the memory of, It should be stored, , types hold-, , four data, , 1. First, , (b) Literals, (a) Variables, , (d) Whole numbers, , (c) Single character, , (d) Operators, , (c) Comments, , 2. Next, , two data, , types hold-, , (a), , numerical, , (d) Top level, , 14. If, , Types, machine, , we use a, , (d), , (c) Literals, adaptable, , are, 6. In Java what, , independent, , in Java:, , (b) Literal, , (a) Variable, , (d) Operator, do, 15. Where, , Characters, , (c), , (d), , we, , declare, , Corrective, , (d), , (a), , bits of precision, , (b), , 13, , there in, , char, , data, , type is not a, , (a) Char, , (c) Comments, , ofitem, , commas, , in, , should not have_, , conventional, , Programs, , (d), , Characters, , syntax., , (b) Square brackets, , 18. Lists, , containing, , more, , separated by:, stored, , colon, (a) Using semi, (b) Using commas, , (c) Using full stops, (b), , if separated, , (d) Round bracket, , (d) Integer, , manipulates, , (a) Information, , with:, , (b) Square brackets, , (c) Angle brackets, , (b) Real, , Which e l e m e n t, , in memory?, , an, , (a) Curly bracket, , 4, , that is, the data, , 17. Thelist, , by, , number?, , (c) Boolean, , 10., , type:, , (d) 16, , (c) 15, Which, , are, , be enclosed, , syntax,, , (d) Round bracket, , (d) Integer, , many, , conventional, , (c) Angle brackets, , (a) Numerical, , 8. How, , by u s e r in, , (a) Curly bracket, , IEEE, , c) Character, , Comment, , Declaration, , not, item should, , used in Java:, set is, , in Java?, , (b) Initial, , 16. To be specified, , c) Single character, , (b), , variables, , (a) Beginning, , 754?, with IEEE, , (b) Integers, , character, , called?, , it is, , Variables, , (a) Real numbers, , 7. Which, , stored in the, the data, to refer to, , namne, , (c) Comment, , (b), , (a) Data types, , of the memory, , of, used instead, refer, location to, , (b) Middle level, , (c) High level, , memory,, , are, Elements which, , are, , (a) Low level, , (b), (c)Primitive Data Types, , 5., , address, , names, , to data is:, , also called:, , are, , Types, Ancient Data Types, New Data, , (b) Alpha numerical, , (a) Numerical, , in which, 13. Language, , Fixed Data, , (d), , machine, , (d) Real, , (d) Word, , in Java, types used, , data in, , () Alphabetical, , (b) Integers, , (c) Single c h a r a c t e r, , 4. Data, , language?, a, , type hold?, , (a) Real numbers, , a, , is, in memory, , needed, , set, what does, , character, , Unicode, From the, data, , address of the, 12. Which, refer, if we want to, , (d) Whole numbers, , (c) Single character, , character, , location, , (b) Integers, , (a) Real numbers, , by the computer,, , remembered, , (d) Using Colon, , than, , one, , item, , can, , be
Page 49 :
308 |, 19., , CHAPTERWISE, , MCas, , (Computer Science, , Which is the, incorrect statement while defining, the variable name?, (a), , 20., , Isc, , following options are the mehg, for, heparin, obtaining nash, invoking object?, code t, , 29. Which of the, , teacher, , It must, , begin with an alphabet underscore (), (6) It must begin with a, percentage sign (, (c) No spaces are, allowed in variables, (d) It cannot be a, reserved word, Which example of, variable is correct?, (a) Int marks;, , (a) int hash(), , (b) int hashcode(), (c) int hashCode(), , (d) interger hashcode(), 30., , (b) Double amount,, interest, , which type of, statement, sets aside, memory for the variable Computer, and associates the, variables name with that, , (a) Data type, (b) Initial, (c) Variable declaration, , (d) Comment, , memory?, , 31., , 32., , 33., , long chat, , (b) Digits, (d) Number, is, a, Which, wrapper for simple data typerh, cha, (a) Float, (b) Character, (c) String, (d) Integer, Which method of integer is used, for conve, the value of an object into int?, (b) int intValuel;, , (b) Variables, (d) Floats, , (c) Data types, 23. Which classes, are not, included in, (a) Byte, (b) Integer, (c) Array, (d) Class, 24. Which of the, is a, , following, , (a) Type wrapping, , (c) Type casting, Which of the, following, and, , (a) Long, , process, , of, , class?, , 34. What, , class is, , a, , integer?, , wrapper, , (a) Float, , 35., , a, , (a) bytevalue(), (c) byteBytevalue(), , (b) byte bytevalue(), (d) Bytevalue(), , 28. Which is a wrapper for data type int?, , (b) Long, (d) Double, , (d) None of the above, , Which of the, , type, , simple data type float?, , converting the value of an object into byte?, , (d) Long Longvalue, are available, in, , conversions, , following is higher data type, , (a) Data type which, holds, data types, (6) Order, , super class of, , method of wrapper float for, , of, , language?, , type whose size, , (C)Order type which, , (b) double, (d) Double, , () float, 27. Which method is, , for, , type, , (b) long longValue, , (c) A and B, , (b) Digits, (d) Number, , (c) Float, , obtain value of, invo, , language?, (a) Narrowing, type conversion, (b) Widening type, conversion, , converting, , (b) Type conversion, (d) None of the above, , (d) Byte Bytevalue, to, , (a) long value (), () Long longvalue(), , Java.language?, , simple data type into a, , Which method is used, object as a long?, , operations, , (a) Real numbers, , (a) Integers, (c)Byte, , wrappers lono, , (c) int Bytevalue(), , performed on it?, , a, , class of, , (a) Bytevalue), , statement, , 22. What is used, to determine the, size of variable the, value it can hold and the, that can be, , 26. Which is, , super, , (c) Float, , 21. In, , wrappers double, , a, , (a) Long, , (d) All of these, , 25., , is, , and integer?, , (c)Floatrate;, , the, , Which, , (d), 36., , All of the, , above, , data, , than, , is more than, ou, , can, , digits than other data, , more, , hold, , more prec, , type, , Widening type conversion i, (a), , Conversion, , of data, from, , lower data type, (b), (c), , higher a, , Conversion of data from, lower, higher data type, Conversion of data from, any aa type, data type, , (d) None, , datatyr, , of the, , above
Page 50 :
Primitive values, Wrapper classes, Types and casting | 309, Owing, , type, , conversion in Java includes?, , 45. A boolean, , of data from lower data, type, , (a) Convers, , to, , literal in Java can be type casted to, , data type., , higher data type, , b)Conversionof, data from, of data, , a, , higher data type to, , lower data type, , rsion of data tronm any data, , ), , C o n v e r s i, , type, , to, , (d), , the, , il in, , (b) Short, , (c) Int, , (d) None of the above, , 46. If a variable or operand in an expression is type, , any, , long, , data type, None, , (a) Byte, , then all the brands, , to, , data type., , above, of the, , blanks, , is the, , type promoted, , are, , result, , of, , a, , narrowing, , type, 0, , 47., , (a) Int, , (b) Long, , (c) Float, , (d) Double, , object oriented programming language, developed by., , Java is, , an, , o n v e r s i o n ., , Loss, , (a), , (d) None of the above, , data, Corruption of, , (), , is, , (a) Oracle, , (b) Addition of data, , of data, , the, , result, , of, , widening, , type, , Loss of data, , (c) No change, in Java, 40. Type promotion, , No, , c), , type, , (b), , Gain of data, , (d), , None of the above, , uses, , Match the following, 48. Match the columns:, , only, , Group A, , conversion, , (a) Narrowing type, (b) Widening type, , (c)UNIX, , (d) Netscape, , conversion in Java., , (a), , (b) Sun Microsystems, , Java program is, , conversion, , Code is faster to, , conversion, , (b) Widening type, , None of the above, , 2Explicit type, , conversion, , la) Narrowing, , type, , (6) Widening type, , (c) No type, , in Java refers, , to, , -, , conversion, , Group A, 1., in, , conversion, , java is, , Primitive, , Narrowing type, , 0), , Widening type, , ), , No type conversion, , 2. Wrapper classes, , a) byte, char, short, double, , (b), , class, , whose, , object, wraps, (ii), (iii), , data type, Convert, , data, , data type, 4., , the compatible, , long,, , a, , ), , conversion, , for, , data, , types, , char., , int, float, , Promotion or type casting, C) float., , Group B, , type to another, , (d) None of the above, are, , convert javabyte|, i n t onative codess, , conversion, , d), , execution, , Speed, , (iv), , also called, , 3. Primitive types, , 4., , slow, , columns:, 49. Match the, , conversion, , type, , (iii), , (d), , conversion, , None of the above, , mplicit, , classes, , 4-(ii), (a) 1-(ii), 2-6), 3-(iv),, 4-(ii), (b) 1-i), 2-i), 3-(iv),, 4-iv), (c) 1-i), 2-i), 3-(ii),, 1-(), 2-(iv), 3-(6), 4-(i), , type conversion, , (d), , 3. Java provides, tools, , 4. Disadvantage of, byte codes, , conversion, , No, , (d), , - t y p e conversion., , conversion, , c), , (ii), , execute, , (d) None of the, uses, Type casting in Java, (a) Narrowing type, , (i), , composed of, , above, , 41., , Group B, Native, , type, , (d) All of the above, , User defined, , (iv), , casting, (a), (b), (), (d), , 1-(i), 2-(6i), 3-(iv), 4-(i), 1-), 2-(iü), 3-(iv), 4-(i), 1-), 2-6), 3-(ii), 4-(iv), 1-(i), 2-iv), 3-(i), 4-(ii), , int, short, long,, , byte
Page 51 :
310|, 50., , iSc, , CHAPTERwISE, , (Computer Science), , MCQs, , data type and, (b) Primitive, class, , Match the columns:, Group A, 1., , Group B, , Primitive data, , (1), , 32 bit, , int in, , 3., , Signed, , 4., , Smallest integer, , java, , i), , 8, , (d), , 51., , Group A, 1. Size of float, and, double, , float b = a/2;, , byte, , System.out.println(b);, , int to long, , (i), , 32 and 64, , (a) 66, , double, , 4., , type, Size of integer, , (d) 65, the, , program code given below, ans, , questions that follow, can, , be handled like, , public class CharClass, , 4, , integers, , public static void main(String args[l), , (i) string, (i) double, , typecannot store, Range of byte data | (ii), , B, , I/ char, , Group B, , 3., , char, , myCharl, char myChar2, , =, , =, , 'A';, "B';, , System.out.println("myCharl: " +myChar, System.out.println("myChar2: " +myChar., , byte, , iv)-128-127, , (a) 1-(i), 2-6), 3-(iv), 4-(ii), , (b) 1-6), 2-(i), 3-(iv), 4-ii), (c) 1-6i), 2-6i), 3-(ii), 4-iv), (d) 1-(i), 2-(iv), 3-6), 4-(ii), , (a) What will be the, (i) myCharl: A, , right, , myChar2: B, , myChar2:C, , (i) myCharl: C, , statement:, , myChar2: D, , intx = 25;, , iv) myChar1: D, , Integer y = new Integer(33);, , What is, , output?, , (i) myChar1: B, , Programming based questions, 53. Choose the, , the, , difference between these, , statements?, , (a) Primitive data types, , Java, , b) A, , Regarding, the, , (d) 1-i), 2-(iv), 3-6),, 4-(ii), , Floating data type, , (c), 56., , Group A, , a, , ch (char)a;, System.out.println(ch);, , Match the columns:, , Character data, , (d) None of the, , int a = ch +1;, , iv) Boolean literal, , 2., , (c) 5.0, , 4.5, , charch 'A'://ASCII 65, , (c) 1-(i), 2-i), 3-(ii),, 4-iv), , 1., , (b), , snippet?, , (a) 1-i), 2-6), 3-iv), 4-(ii), (b) 1-), 2-i), 3-6v), 4-(ii), , 52., , (a) 4.0, , 55. Choose the correct output of the, , (1), , (ii), , Not an integer, data type, , follown, , int a-9;, , Group B, , Automatic type, conversion, 3. Word true is, , the correct output of the, , Code:, , (iv) int, short, long, , type, , doiect ot aWta, , None of the above, , 54. Choose, , (ii) byte, , (a) 1-ii), 2-(6), 3-(iv),, 4-(i), (b) 1-6), 2-i), 3-(iv),, 4-(ii), (c) 1-i), 2-i), 3-(ii),, 4-(iv), (d) 1-i), 2-iv), 3-6),, 4-(ii), Match the columns:, , obion, , (c) Wrapper class, , types, 2., , an, , two, , myChar2:E, , (b) What, , is, , the name of, the, ) System.out.println class?, , (i) statie void, main)
Page 52 :
Primitive values, Wrapper classes, Types and casting| 311, , (a) What will be the output?, (ii), public, , (i) myShort: 6000, , ( i v )C h a r C l a s s, , the program code given below,, , Concerning, , (i) myShort: 7000, , the, , nswertthe, , that follow:, questions, , (ii) myShort: 8000, , uiblicclass ShortDataType, , static, , (iv) myShort: 4000, , (b), , main(String args|), , void ma, , public, , What is the n a m e of the data, , ), myShort, , short, , ", , ShortDatatype, , (i) static void main(), , myShort);, , +, , System.out.printin("myShort:, , to store, , myshort price?, , 6000;, , =, , type used, , (ii) public, (iv) Short, , Answers, , 20., , bracket, (a) Curly, (b) Using, with a, (b) It must begin, (d) All of these, , 21., , (c), , 17., utiple choice q u e s t i o n s, , 18., , 19., 1. (b)Integers, , Explanation: Integer., , ,Floating-point, , number., , Character. Boolean, , 2 (a) Real, , commas, , Variable, , declaration, , percentage sign, , (%), , statement, , 22. (c) Data types, , numbers, , 23. (c) Array, , character, , 3. () Single, Types, 4(0) Primitive Data, primitives, , 24., defined, , conversion, variableName, , Explanation: Syntax, , in Java, , eight, boolean,, Explanation:, float, double,, long,, short,, and, are int, byte,, considered objects, , (b) Type, , ( d a t a T y p e ), , dataType, , v a r i a b l e T o C o n v e r t ;, , The, , those aren't, , and char, , 25., , (d) Number, , 26. (a) Float, , represent raw values., , 27., , bytevalue0, (b) byte, , 28. (a) Integers, , 5. (a) Data types, , Explanation:, , 6.(a) Realnumbers, , mechanism, , the, , . (c) Character, , and, , &. (d) 16, Explanation:, , Unicode, , data type, The char, , is, , a, , It has, , a, , single, , value, , of "|, , and, , uffff, value of "\, , (or, , a, , 65,535 inclusive)., 9. (c) Boolean, Explanation: The, RUE, , or, , BOOLEAN, , FALSE data, , a, values a s, , data, , type, , stores, , single byte., , 29., , (c), , primitive, , primitive., , int hashCode(), , int int Value();, , 32., , (b), , 33., , longValue(), (b) long, , 34., , (c), , 36., , A and B, above, , (d) All of, (b) alteration of, , data, data from lower, , type, , to, , type, , to, , higher data type, , 1 (a) Variables, , 2 (a) Numerical, , 37., , (a) Variable, Syntax type, , a5. (a) Beginning, . (c) Angle brackets, , (b), , alteration, , of data from, , lower data type, , (o) High level, Xplanation:, , convert, , 30. (d), 31. (b) Character, , 35., , (b) Programs, , to, , Java provides, into object, , Number, , maximum, , uOOOO (or 0), , object into, , class in, wrapper, , 16-bit, , minimum, , character., , The, , variable, , =, , value;, , Fill in the blanks, 38. (a) Loss of data, , a, , higher, , data
Page 53 :
312 |, , Isc, , CHAPTERWISE, , McQs, , (Computer Science)-Xi, (c) No change, 40. (b), Widening type conversion, 41. (a), Narrowing type conversion, 42. (a), 39., , 43., , (b), , 44., , Narrowing type conversion, Widening type conversion, , 51. (a) 1-i), 2-(), 3-(iv), 4-(ii), 52. (a) 1-i), 2-6i), 3-(iv), 4-(iii), , Programming based questions, (b) Primitive data type and, , (d) AlIl of the above, 45. (d) None, of the above, , 53., , 46. (b) Long, , 54. (a) 4.0, , 47., , 55. (c) B, , (b) Sun, , Microsystems, , Match the following, 48. (a), 49., 50., , 1-i), 2-), 3-(iv), 4-(ii), (a) 1-i), 2-4),, 3-(iv), 4-(ii), (a) 1-(ü), 2-(),, 3-iv), 4-(ii), , class, , 56. (a) (i) myChar1: A, , myChar2: B, , (b) iv) CharClass, 57. (a) (i) myShort: 6000, , (b) (iv) Short, , an, , object, ect nof aw
Page 54 :
C h a p t e r, , Variables, Expressions, , 7, wTapye, , 7. A variable, , Multiple choice q u e s t i o n s, , name, , never, , should, , begin, , with., , (a) A number, , Wheredo, 1, , we, , declare, , (b) Special, , local variables?, , outside of, inside the class and, declares, al lt, the class with static, declares inside, , and, , outside, , (c), , none, , (d), , (c), , we, , 9. Which, , declare instance, , () It, , (d), , declares inside, , 3. Where, , do, , we, , inside, , declares, , and, , outside, , C), , It declares, , d), , none, , *Which, , n, , Java, , of these, , element, , can, , the, , (), , class with, , (c), , static, , prefix, , 12., , (a), , method., , used a s, n o t be, ?, language, , (b), (c), , variablename, , is called:, , (c)ldentifier, n a m e, , ?, , variable, , invalid, , (b), , T e n t hTeam, , ariable, , (a) tenthTeam, , (c) 10thTeam, , 1 and 0 of, , None, , (d), , types, , are:, , with, , Boolean, , logical, , data, , Bits, , individual, , characters, , of a String, , of the above, , (a), , true/false, , 0 and 1, , boolean data, , individual, , Characters, , None, , of, , of a, , of the, , Above, , 15., , bits of data, , String, , the above, , logical operators, , (c) Binary operators, , is, , we use, , boolean, , (a) Logical operators, , n a m e, , Above, , in Java ?, , true/false, , 14. Bitwise, , above, , All of the, , and (b), (d) (a), , Logical, , type do, , None, , (d), , (b) Constant, , Vhich varial, , Arithmetic, , (d), , (c), , and Keywords, , (a) Data Type, , (a), , (d), , Bitwise, used with, c a n be, of data, 13. Which type, in Java?, operators, logical, , C) Identifier, , None of the, , variable, , (b) Boolean Logical, , Which data, , (b), , variable, , Above, , the valid, , Logical Operator, two possible, , operators, , (6) Keywords, , (d), , are, , names, , (a) Bitwise Logical, , of, , outside, , (a) literal, , Name of, , variable, , £lstLevel, , 11. The, , variables?, , programming, , ldentifier, , All of the, , (d), , (b)_1stLevel, , of method., , inside, , variable, , invalid, , (b) first Level, , (a) $1stLevel, , and, the class, , the, , inside, , declares, , the, , are, , names, , of the Above, , names?, , of these, declare class, , variable, , firstLevel, , 10. Which, , the method., , method., , (b) It, , preix, , method., outside of, , none, , (a) It, , static, , None, , (d), , (a) 1stLevel, (c), , With, the class, declares inside, , and, , (b) &5thteam, , names?, , variables?, , outside of, the class and, , inside, , declares, , name., , valid variable, , a, , ()_5thTeam, , method., , method., , (b) It, , 8. Choose, , (a) 5thTeam, , of these, , do, 2 Where, , (a) It, , the, , and dollar, , underscore, , sign, , of method., , inside, , It declares, , prefix, , but, , All of the above, , method., , b)It, , characters, , Input used, , for, , are, , also called, , (b) Bitwise operators, , (d), , None of the above, , Logical Operators are:, , (a) 1 and 0, , b) true/ false, , (c) char/ String, , (d), , None of the above
Page 55 :
314, 16., , |, , IsC, , CHAPTERWISE MCcas (Computer Science X, , Output given by, , in, , Logical operation, (b) true or false, , any, , (a) 1 or 0, , (c) char, , 27., , Java:, , String, (d) None of the above, Logical operator works with a Singie, Operand?, , (a), (c)#, , NOT, , operator, , he machine, , (d), Java:, , 20. What will be, the output of, if, one, operation, of the, , OR (), is false?, , Logical, , AND (&), is false?, , output, , (a) false, (c) true or false, , for, , Logical, , a, , 29., , OR, , (1), , 30., , of, , a, , Logical, , (a) false, (b), (C) true or false, (d), 23. What will be the, output of, operation if both, (a) false, (b), (c) true or false, (d), 24. What will be, the, , AND, is true?, , output, , are, , None of the above, of a, Logical OR (1), , (d) None of the above, 26. Which operator is fast, OR (11) operators, , 1;, , in Java?, , and Short Circuit, , (a) OR Operator, , (b) Short Circuit OR operator, , (b), , (a), , 34., , in, , Java, , that, , g've, , (b)@, , %, , 33., , 2, , (d) Compiler eror |, , arithmetic operator, Remainder of Division is, , (d) &, , What type of, , associativity, +,*and %, have?, , do Arithmeue e, , o, , (a) Right, , to, , Left, , (c), , (b) Left to Right, , to, , Right, , (d) Left to Left, , Right, , Which of the, , priority?, OR(1), , (d) Compiler Er, output of Java code snipse, , 32. The, , (b) Short Circuit AND, , speed, , (b) 10, , 9, , (c), , (a) AND operator, , same, , -5, , System.out.println(k);, (a) 1, , true, , (d) None of the above, Which operator is fast AND, (&) and Short Circuit, AND(&&) operators in Java?, , the, , ot, , All of the, abore, Java code sip, , short k p+2;, , AND (&), true?, , (b) false, , (c)true or false, , Choose the correct output, , short p, , operation if both the inputs/operands are true?, , (a) true, , (d), , 31. Choose the correct, , Logical, , inputs/operands, , (b) *,/=, , (a), (c), , (&), , true, None of the above, a, , (a) +,, (c)%=, , System.out.println(a);, , (d) None of the above, , output, , Art, , Which is the correct Compound, Assion, sige, Arithmetic Operators in Java., , int a = 2 - - 7;, , (b) true, , operation when inputs/operands, , at, , in, , (d) All of the above, , (d) None of the above, , operation when inputs/operands is truue?, , (c) Both work, , involved in, , [Decre, , (b) true, , (c)true or false, , 25., , are, , (b) Multiplication ("), Division (), (c) Modulo Division (%),, Increment/De, (++/--), Unary Minus , Unary Plus (, , Logical, , inputs/operands, , 22. What will be, the, , operators, , processing power, , (a) Addition (+), Subtraction (), , (d) None of the above, , 21. What will be, the, , None of the above, , 28. Which, , (b) true, , (a) false, , CPU, , (d), , inputs/operands, , (a) false, (c) true or false, , in, , (c) By using, , extra, , (b)!, a, , ., , (b) By using extra memory on the, , expression in Java, , 19. What will be, the output of, if, operation one of the, , Short, , sio, , if possible and save time., , (a) Logical AND, b) Logical OR, (c) Logical Exclusive OR, (d) Logical NOT, , Logical Unary, , and, , (a) By skipping the second exprese., , 17. Which, , a, , (&&, &), , OR (I1) operators are tast in Java? o, , or, , 18. Which is, , Short Circuit AND, , Why, , (a) Postfix, , following operato, , operators, , Prefix operators, , (6) Prefix operators, Postfix operators, , 1ore priority, have more, P, , dve more, have, more priorit, , () Both work at the same speed, , (c) Both Prefix, and Postfix, , (d) None of the above, , (d) None, , priority, , of the, , above, , ave ", , operato, , 1ave
Page 56 :
Variables, Expressions, , lowing operator has less priority?, , of the follov, , Which, Decrement has, Postfix, , less, , (a), , is the order of, , 42., , priority than Prefix, , c, , r, , e, , m, , e, , to, , &, , ix Increment has less priority than Postfix, e, , precedence (highest, , lowest) of following operators?, , I n c r e m e n t, , D, , 315, , n, , 2., , t, , 3.?, operators have same priority, (a), , (d), , the above, None of, , is the associativity used by Increment and, , %Ho, D, , e, , c, , (a), (c), , r, , e, , m, , e, , n, , t, , arithmetic operators in Java?, , Left to Left, , Which, , of the following, , (b), , * /, %), , (c) Boolean, , None of the mentioned, , operators, , 45., , operate, , can, , on, , a, , boolean variable?, , group have, , 1. &&, , 3.?, 4.+, (a) 3 & 2, , (b) 1&4, , (c) 1,2&4, , (d) 1,2 &3, operators can skip evaluating right, , 46., , Fill in the blanks, , hand operand., evaluate to in, , expression1? expression2, , (d) &&, , ) &, , using ternary, , expression3, , (b), , (a)!, , should be expression1, line?, operator in the following, , operator is having highest precedence., , 47., , (b), , (a)0, , (a) Integer, , Floating point, , <, and, , (b) Floating -point numbers, (d), , -, , by greater than,, , returned, , (a) Integers, , (d) None of the above, 39. Operator with highest precedence:, (b), (a) ), (d), (c), , numbers, , (c), 48. Expressionl should be,, , () Boolean, (d) None of the above, stored in, is the value, , 41., , highest precedence, , equal to, operator?, , than (+,,1, (b) (+, -) group has lower priority, %) group, , ), , have, , operator, /, has higher precedence, than multiplication operator, Addition operator, +, and subtraction operator, , 44, , o)group, , ,, , (), , have equal precedence, , higher priority in operator, */,%) in Java., groups(++,, than (+, ,*/,, (a) (++,) 8roup has higher priority, , (+,, , operator has least precedence, , Division, , (d), , with, 38. Choose the group, and, (+, ,, --), , and, , to, , Brackets, , (c), , All the above, , 40., , statement is incorrect?, , (a) Equal, , is the correct statement, , (b)and/haveequal priority, c)/and % have equal priority, , (C)(, -) group, equal priority, , (d) 2->3>1, , 43., , aboutJava Operators +t,,*/and %., (a) +and- have equal priority, , (d), , (b) 2->1->3, , =, , (c) 3->2->1, , (b) Right to Left, (d) Right to Right, , Left to Right, , 1->2->3, , x, , (d) >>, to evaluate using, , ternary operator?, , in the following, , expressionl ? expression2: expression3, , lines of Java code?, , (a) Integer, , int x, y, z,, , (b) Floating- point numbers, , X= 0;, , (c) Boolean, , y=1;, , X=y z=8;, (a) 0, , (b), , c)9, , (d), , 49., 8, , (d) None of the mentioned, is the, , of code?, , value stored in x in, , following lines
Page 57 :
316 |, , IsC, , int, , x,, , CHAPTERWISE, y,, , MCQs, , (Computer Science, , XII, , conditional, , y=1;, x, , operator, , = y = 8;, , (iv) Must retu, , 4. Character escape, , z, , (a) 0, (c) 9, , code not in java, , (b) 1, , value, , (a) 1-(i), 2-), 3-(iv), 4-(ii), , (d) 8, , (b) 1-), 2-(i), 3-(iv), 4-(ii), , Match the following, 50., , (ii) \\, , 3. False Part of, , Z, , x =0;, , (c) 1-(ii), 2-(i), 3-(iii), 4-(iv), , Match the columns:, , (d) 1-i), 2-(iv), 3-(i), 4-(iii), , Group A, , 1., , Operands of, , arithmetic, , (i), , Modulus operator, | (ii), %,, , 3., , Operator, â"a",, , decreases the, 4., , value, Highest order, , precedence, , and, Integers, floating point, , Group A, , &, , 2., , ii) (),, , | (iv) by1, , Group A, , 2., , operators, Colon (?:), operator (ii), , 54., , Ternary Operator, , a, , return?, 4., , conditional, , operator, , (i), , =, , 35, , 0 (ii), , Anonymous inner| (iv), , int, It, , has, , no 57, , name, , Infinity, , Programming based questions, 55., Group B, must, , return, , a, , value, , (ii), , Oxnf029L, , 3-(ii), 4-(iv), (d) 1-i), 2-(iv),, 3-(i), 4-(i), , 52. Match the columns:, , True part of, , Group B, , (a) 1-(ii), 2-(),, 3-(iv), 4-(ii), (b) 1-6), 2-i),, 3-(iv), 4-(ii), (c) 1-i), 2-(),, , Operator, , operator, , sequence, , Match the columns:, , 2. Valid long literal, (i), Float, , (iv) Conditional, , (a) 1-(ii), 2-i), 3-(iv), 4-(ii), (b) 1-i), 2-i), 3-(iv), 4-(ii), (c) 1-(i), 2-i), 3-(ii), 4-iv), (d) 1-i), 2-(iv), 3-(i), 4-(ii), , 2., , bugs iv) Unicode escar:, , class, , (i), , COde, , (i) JDB, , the hash Code(), method, , operator, , 1. Assignment, , u0021 article, , Group A, , Combine, two |, boolean values, (ii) true or false, , Group A, , Byte, , (c) 1-(4i), 2-), 3-(ii), 4-(iv), (d) 1-(i), 2-(iv), 3-(i), 4-(ii), , operator, a Java Ternary, , Use of pointer, , executed by JI, , (a) 1-(i), 2-(i), 3-(iv), 4-(ii), (b) 1-(), 2-(i), 3-(iv), 4-(ii), , Group B, , && and I, , Condition of, , Java features | (ii), , Return type of, , 1., , 4., , a, , Find and fix, , columns:, , Java Ternary, , Not, , | 3., , operator, , 3., , (i), , security of Java, , Numeric, Characters, , (a) 1-i), 2-(), 3-(iv), 4-(ii), (b) 1-), 2-6i), 3-(iv), 4-(ii), () 1-6i), 2-6i), 3-(i), 4-iv), (d) 1-(i), 2-iv), 3-i), 4-(ii), , 51. Match the, , Group B, , 1. Portability and, , numbers, , operators, 2., , 53. Match the columns:, , Group B, , Assignment and, Lambdaoperator|, , Choose correct, output of Java code snlr, short k=1;, , k+ 2;, , System.out.println(k);, (a) 1, (b) 2, , (c), (d), , 3, , Compiler error about Type Cast
Page 58 :
the, to the, arernce to, , reterence, , INith, the, , questions, , program, , code, , that follow:, , given below,, , Natural, , Variables, Expressions 317, Numbers is = "+Sum),, , utblic c l a s s R e v e r s e N u m b e r, , nublic static void main(Stringl] args), , (a) What, (i), , is the, , output, , of the, , following program?, , Sum of First 100 Natural Numbers, is =5050, , int number = 987654, reverse = 0;, , (ii) Compilation error, , while(number != 0), , (iii) 15, , (iv) Runtime error, int remainder = n u m b e r %, reverse =, , reverse, , *, , 10+, , 10:, , (6) What is the name of the class in the above, , remainder;, , number = number/10;, , program?, (i) Constructor, (ii) Sum of Natural Number 2, , System.out.println("The reverse of the, given number is: "+ reverse);, , (ii) Stringll args, (iv) Name, 58. Regarding the program code given below, answer, , the questions that follow:, , al What is the output of the following program?, , public class CheckPositiveOrNegative, , ) The reverse of the given number is: 456789, , (ii) Compilation error, , public static void main(String[] args), , (ii) 15, , iv) Runtime error, , b) What is the name of the class in the above, , I/number to be check, int num-912;, , program, () Constructor, , //checks the number is greater than 0 or not, , if(num>0), , (ii) ReverseNumber, (Gi) String] args, (iv) Name, , . Regarding the program code given below, answer, , System.out.println("The, positive.");, , number, , is, , the questions that follow:, , public class SumOfNaturalNumber2, , //checks the number is less than 0 or not, , else if(num<0), , public static void main(Stringl| args), System.out.println("The, negative.");, , int num = 100, i 1 , sum = 0;, , number, , is, , true, l/executes until the condition returns, , while(i= num), , lexecutes when the above two conditions, return false, , /adding the, , value of i into, , sum, , variable, , else, , Sum = sum + i;, , /increments the value of i, , by, , 1, , it+, /prints the sum, First 100, ystem.out.println("Sum of, , System.out.println("The number is zero.");
Page 59 :
318 |, , isc, , CHAPTERWISE MCQs (Computer Science)- Xu, , (a) What is the, output, ) The number is, , (i) The umber, , the, , of, , (b) What does the above, , following program, , program do, , (i) Initialize a number, , positive., is, Negative., , (i) Check whether the number, s puslie, , negative, , (ii) 15, , (ii) Give odd or even number, , (iv) Runtime error, , (iv) None of the above, , Answers, , Multiple choice questions, 1., , 12. (a) true/false boolean data, , (c) It declares inside the method., Explanation: A variable declared inside the body, of the method is called, local variable. You can, use this variable, within, only, that method and, the other methods in the class, aren't even aware, , 13. (b) 0 and 1 individual bits of data, , the variable exists. A local, variable cannot be, that, defined with, , "static", , 2.(a), , (b) Bitwise operators, Explanation: Java defines, , 14., , keyword., , It declares inside the, class and outside of, , operators,, , which, , can, , be, , several bir, , applied, , to, , types, long, int, short, char, and byte., 15., , the in, , (b) true / false, , 16. (b) true or false, 17., , method., , (d) Logical NOT, , 18. (b)!, , Explanation:, , Instance variables are declared in 19., (c) true or false, class, but outside a method, constructor or, any 20. (a) false, block. When space is allocated for an, , a, , the, , (6), , in, , 21., , It declares inside the class, with static prefix, and outside of method., , 25., , created., 3., , object, , slot for each instance variable, value is, , heap,, , a, , Explanation: Class variables also known as static, variables are declared with the static, keyword, in a class, but, outside, , a, , method, constructor, , (b), (c), , 22., , 25., , Explanation:, , Short-circuit., , in Java are, symbolic, for, used, names, identification. Ihey can be a class, name,, , method name,, , name, constant name, and more., 6. (d) None of the Above, , (c) All of the above, , 8. (c)5thTeam, All of the Above, Al of Above, A and B, , 26., , If there is an, , expres on, , (6) Short Circuit, OR operator, , By, if, , Fvnlanation: Identifiers, , 11., , ..., , then short circuit, Xpre, occurs, the further exp, not, evaluated and false is returned., , 27. (a), , 5. (c) Identifier, , 10., , Java logical, , &&(logical AND), and first operand it8eu, , that act as a key to a code., , (d), (d), (d), , In, , operators, evaluation of a logical, expression exits m, before, complete evaluation, then it s, as, , or a, , Explanation: Java keywords are also known as, reserved words. Keywords are particular words, , 9., , false, , (6) Short Circuit AND, , 4. (b) Keywords, , 7., , or, , (5) true, , are created from it., , variable, , true, , 24. (a) true, , block. There would only be one, copy of each class, variable per class, regardless of how, many objects, , name,, , true, , 28., , skipping the second expressiosion oro, , possible and save time., , (d) All of the above, 29. (d) All, of the sha, bove, package 0., (c)9, 31. (d), 20, , 32. (), 33., , (b) Lett, , 34. (a), , 35., , Compiler error, to, , Postfix, , Right, , operators, Prefix operators, , (b) Prefix, , Ore, , have, , prior, , n, , CTement has less, Inerement, has less priori, Decrement, , t h a n
Page 60 :
Variables, Expressions| 319, to, , Left, , 52. (a) 1-(ii), 2-(i), 3-(iv), 4-(ii), , Right, , b), All of, , the, , above, , d), (,8roupha, , (, , a, , higher priority than (+, , */,, , 53. (a) 1-(i), 2-6i), 3-(iv), 4-(ii), , 54. (a) 1-(i), 2-6), 3-(iv), 4-(ii), , ), , %)group, , Programming based questions, , (a)0, , il, , in the, , ( ¢ ), , blanks, , 55. (c) 3, , B o o l e a n, , 56., ., , (d)8, , (a) (i) The, , reverse, , of the, , given number is: 456789, , (b) (ii) ReverseNumber, , (a)1->2->3, , ()., (o), , Division operator,, , 1, has, , higher precedence, , than multiplication operator, Boolean, , s(d)1,2&3, (d) &&, . (a) 0, 6. (¢) Boolean, , (d) 8, Match the following, , 57., , (a) (i) Compilation error, Explanation:, , When, , overloaded., another Test, , Constructors, , 51., , be chained and, , is called,, , object calling the, , it creates, , constructor, , Test(int, , temp)., (b) (i) Sum of natural, , Number 2, , 58. (a) (i) The number is positive., , b) (ii) Check, , whether the number is, , negative, , (a) 1-(i),2-i), 3-(iv), 4-(ii), (a) 1-(), 2-6i), 3-(iv), 4-(i), , Test(), , can, , positive, , or
Page 61 :
Chapter, , Statements, Scopa, , 8, Multiple choice questions, 1., , Which selection statements, (a)iif, , 7. As input before branching IF or ELSE IE., test, , only, , for, , equality?, , (6) switch, , Java?, (a) if(), C)continue, 3. Which of the, , of, , used in, , 9., , (b) for(), will execute the, when condition, controlling the, , State TRUE, be followed, , or, , by, , FALSE., an, , Jump, , statements that can, remainder of the code in its, , iteration are., , skip processing, , body, , for, , a, , (b) return, , ()exit, , (d) continue, , toin java, , particular, , efficient than, , statements, , IF-ELSE statement is also calle, (a) Branching statement, (b) Control statement, Block statements, , or, , (a) FALSE, , State TRUE, be, , a, , set of, , boolean expression, nested, , preceded, , by, , ., , (b) ELSEIF, , 12. State TRUE, , 13., , (c) switch statement can only test for equality,, whereas if statement can evaluate any type of, create a, , statement, , (d) None, , FALSE. A Single-Line, comult, if () and Left Brace (1), , allowed in between, , (b) two case constants in the same switch can, have identical values, , to, , should be, , (c) IF or ELSE IF, , switch, , (b) TRUE, , S, FALSE. IF statement, defined in between two Braces. code, or, , (a) FALSE, , nested ifs, , possible, , IF statement sho, , ELSE-IF, , (b) FALSE, , (a) IF, the, , 5. Choose the statement which is incorrect., more, , or, , statement in Java., , (a) break, , (a) switch statement is, , Every, , ELSE, , (a) TRUE, 11. ELSE statement, , (d) ALL, , similar, , are, , (d) None, 10, 10., , (d) none of the mentioned, , (c), , IF-ELSE statements, , (c) Both C and C++ style, , following loops, , loop even, , is, , statementin, , (b) conditional, (d) optional, , (b) C++ Style, , (d) break, , (c) for, , 6., , (d) char, , (c) iterative, are, , (a) do-while, (b) while, , (d) it, , (c) float, , (a) C style, , loop is false?, , 4., , b) int, , (a) boolean, , (d) none of the mentioned, Which of the selection statements, , body, , (a) boolean, , 8. IF statement is also called a, , (c) if & switch, 2., , stater, , accepts, , 14. State, , TRUE, , (b) TRUE, , FALSE. Code which is insi, ELSE statement, should be, , 15., , or, , surrounae, (a) FALSE, (b) TRUJE, State TRUE or, ELS, FALSE An ELSE or, statement can not, out IFstate, exist alone, , in Java., , (a) FALSE, 16. In, , condition, only if, the, , without, , (b) TRUE, , of, , a s s e s s t o bo", , IF, , statement ass, expression, logical operators contains?, , (a), (b) relational operators, (c) boolean operands, (d) All
Page 62 :
Statements, Scope, of, , condition, , IF-statement is, , an, , I be, whichstatementwill, , false,, , 24. Choose the correct, , true., , IF, , block, , ELSE, , b), , is, , executed., , block is, , IF and, , executed., , 4;, , blocks are skipped., , ELSE, , Both., , (), , blocks, F and ELSE, of code that, nium lines, , executed., , are, , d) Boti, , a, , Java, , styleIIF,, , ELSE, , or, , can, , be written inside, , IF-ELSE block., , (d) None, is, , an, , (c) Compiler error, , (d) None, , if(true), , (c) 512, , statement, , (b) 4, , with IF statement:, , (a) 32, , F-ELSE, , (a) 0, , of the Java program, 25. Choose the correct output, , (b) 64, , p. How, , better than, , a, , SWITCH s t a t e m e n t ., , for, (a) Checking, for, (b) Checking, , break;, , More-than condition, , System.out.println("ELEPHANT");, , Less-than condition, , (c)Checking for Ranges, , (b), , number of, , between, , present in, statements can be, , ELSE-IF statements, , starting, , ), , IF and, , ending, , ELSE, , (d) None, , 128, , of Java program with IF, 21. Choose the correct output, , (d) None, , (c) Compiler error, , that can, , 26. A, , SWITCH, , case, , (b) Loop, , (c) Selection, , (d) Jump, , to SWITCH in Java language:, 27. The alternative, (b) for, while, (a) break, continue, , (d) goto, exit, , (c) if, else, , if(1), , 28. The, , keywords used, , to, , Choose the, , (d) None, , (d) All, , (c) break, , (b) No output, , correct, , SWITCH in, , java, parts of a, condition, (a) switch input, , 29. The, , program, output of the Java, , with IF-ELSE statements:, , (b) case constants, , if(TRUE), , (c) case statements, , else, , type of, , 30., (b) STOP, , hoose the correct output, , as, , input, , is, , program:, , (d) All, (c) int, 31. In Iterator, hasMoreElements(), , int a=10;, , Enumeration has been changed to:, , if(a--9), , (a) hasNextElement(), , System.out.println("OK ");, System.out.println("MASTER");, , else, ystem.out.println("BYE");, (b) BYE, , a) OK MASTER, , ) Compiler error, , (d), , None, , accepted by, , a, , (b) short, , (a) byte, , None, , of the Java, , data, , SWITCH statement., , System.out.println("STOP");, , (d), , includes:, , (d) All, , System.out.println("GO");, , () Go, () Compiler error, , case, , (b) default, , (a) switch, case, , 2., , SWITCH, , implement a, , in Java language., , System.out.println("OK");, , (c) Compiler error, , control, , a, , (a) Iteration, , statement:, , (a) OK, , is, , statement, , statement in Java., , (b) 64, , (a) 32, , ELEPHANT, , (a) No output, , (d) All, , 20, Maximum, , of the Java program., , if(3>1), , When, , a), , output, , 321, , (c) hasNext(), 32. What is used, elements?, , (a) HashMap, , ()TreeMap, , method, , of, , (b) isNext(), , (d) name remains same, by TreeSet internally to store, , (b) LinkedHashMap
Page 63 :
322| Isc CHAPTERWISE MCQs (Computer Science)-Xi, , (b) break eyword, (d) None, , (a) case keyword, , 33. Which statement is an iteration statement?, , (a) switch, , (b) if-else, , (c) i, , (d) do-while, , (c) default keyword, 40. The main purpose, , data type is accepted by a switch statement, , in Java., , a, , SWIT, , in Java., , CH log, , to define ranges, , (a), (b), , additions, to define, , (c), , to, , improve, , switch block, , performar, , (d) None, , (a) enum, , (), , design, , a fall-through is, , Fill in the blanks, , 34, , to, , and, , enunm, , 35., , (b) String8, (d) long, , String, , (a), , version of Java supports String as the, , 36., , =, , is not, , 99; i >=0; i/9), , valid, , (c) for (inti =20;i>=2;--i), , (b) JDK 6, , (c) JDK 7, , for ( int i, , (b) for ( int i = 7; i = 77; i += 7), , input data type of a SWITCH., (a) JDK 5, , loop declaration, , for, , 41., , (d) for ( int i = 2; i <= 20; i = 2*i), , (d) JDK 8, , is not, , 42., , is the output of Java program with, , Switch., int a=10;, , flow control statement in, , (a) break, , (b) continue, , (c) exit(), , (d) returm, , lats, , is acceptable types for x, , 43., , switch(a), , a, , switch(x), , case 10: System.out.println("TEN");, , default:, , System.out.println("Hello");, , (a) No output, , (b) TEN, , (c) Compiler error as there is no BREAK., (d) Nonhe, , 37., , is the, , output of the Java program., , (a) short, , (b) char, , (c) long, , (d) float, , Match the following, , int b=20;, 44., , switch(b), , Match the columns:, Group A, , default: System.out.println("LION");, , 1. Loop statement, , (a) No output, , 2. Empty loop in, , Group, B, , (c) Compiler, , error, , as, , there, , are, , no, , CASE, , (ii), , Which is execute, , initialization, , Java, , (b) LIONN, , (1), , It has empty, , repeatedly claus, , 3., , nested loop, , 4., , Functionality of, , (ii), , statements., , currentiteration, , (d) None, is the, , 38., , output, , of the, , Java program., , (a), (b), (c), (d), , switch(animal), , break: System.out.println("DOMESTIC");, 45., , (c), , fall, 39. A SWITCH, in Java., of, , Loop, , -, , (d) Compiler error, , through o c c u r s only in, , 1-i), 2-6i), 3-(iv), 4-(ii), 1-(i), 2-i), 3-(iv),, 4-ii), 1-i), 2-i), 3-(ii),, 4-(iv), 1-(i), 2-iv), 3-(i),, 4-(ii), , A Loop withind, , Match the, columns:, , (b) GOAT, , DOMESTIC, , (iv), , break statement, , String animal = "GOAT";, , (a) No output, , To terminate, , the absence, , 1., , Group A, Functionality, of continue, , statement, , Group B, (i), , do while loop, r u n s o n c e even, , Conditional clau, is false
Page 64 :
Statements, Scope, , 3. Control, , iteration, , between d o, , expressions for an, , while l o o p a n d, , while loop in, , 4., , Java, , Switch, , statement, , (ii) Used inside the, , switch to terminate, a statement, , sequence., Break s t a t e m e n t, , (iv) Dispatch execution, to different parts, of your code based, on, , the value of, , immediate, termination of, , Break statement, , the loop, Boolean, , (iv), , expression, , (c)1-(i), 2-(i), 3-(i), 4-(iv), (d) 1-(i), 2-(iv), 3-(i), 4-(ii), 48. Match the, , columns:, , Group A, , ) 1-6i), 2-), 3-(iv), 4-(ii), 2., , ) 1-ti), 2-6), 3-(i), 4-(iv), , Switch, , GroupB, ), , select among a, large group of, values, , (ii), , Useful when you, , statement, , process a menu, , ) 1-4), 2-iv), 3-6), 4-(i), , selection., , 3. Default is an, , Match the columns:, , Group A, (ii), , statement, , iii), , statement, , expressiorn does not, match with any of, the case values., , provides a better, alternative than a, large series of ifin the same switch, can have identical, , No two case, , (iv), , constants, , 8) 1-i),, , "Hello World"?, , expression, , switch(a), , "a" to, , print, , (a) int and float, (b) byte and short, , Match the columns:, , (c) char and long, (d) byte and char, , Group B, , Variable, declared ii), inside the for, control loop, , type for variable, , System.out.println("Hello World");, , 3-(iv), 4-(ii), 91-), 2-), 3-(ii),, 4-(iv), 4) 1-ti),, 2-(iv), 3-4), 4-(11, , statement, , 49. Choose valid data, , to the conditional, , 2-4), 3-(iv), 4-(ii), , (i), , 1-(i), 2-(4), 3-(iv), 4-(ii), 1-), 2-i), 3-(iv), 4-(i), 1-i), 2-), 3-(ii), 4-iv), 1-(), 2-(iv), 3-(), 4-(ii), , Programming based questions, , transferred directly, , A, , (a), (b), (), (d), , control to be, , b) 1-(),, 2-(i),, , 1. AGroup, switch, , clause., , Value of the, , test for equality, , values, 4., , More than one else, , switch can only, , else-if statements., 3. A continue, , (ii), , optional case, |4. One if can have (iv), , Group B, , Switch statement | (1), , you can forcee, , if statement, , | 1. do-while, , 1-6), 246), 3-(iv), 4-(ii), , (iii), , (a) 1-(i), 2-6), 3-(iv), 4-(ii), (b) 1-(), 2-(i), 3-(iv), 4-(ii), , an, , expression., , 2 Conditional, , 323, , To continue current, , (ii), , Ditterence, , 50. Will the, , Cannot be, , reference outside, , given Java code-snippet be compiled?, , switch(45), , the loop., case 10:;, , usually more, , efficient than a, , set of nested, , ifs., , (a) NO, , b) YES
Page 65 :
324|, 51., , IsC, , CHAPTERWISE, , MCQs, , (Computer Science)-*", , Choose the correct, output for code, , variable a=10?, , snippet, , ", , if(a=0), , (a) Infinite, , (b), , (c) 0, , (d) 4, , 56. Concerning, , the, , program, , 9, code, , given, , answer the questions that follow:, , if(a-0), , I/It is a program of odd and even nt, , numbers., , public class IfElse, , System.out.println("1 ");, public static void main(String[] args), else, I/defining a variable, , System.out.println("2 ");, , int number=13;, , //Check if the number, if(number%2==0){, , System.out.println("3 ");, (a) 12, , (d) 3, , 52. How, many times will the, ch "b';, , while(ch >-'a', , && ch, , (a) 0, , loop, , divisible by 2., , System.out.println("even number", , (b) 23, , (13, , is, , else, be, , executed?, , System.out.println("odd number";, , <= 'z'), (b) 25, , () 26, , (d), , 53. Choose the correct, , 1, , (a) What will be the output?, , output of the Code., , (i) odd number, , void main(), , ii) even number, , (i) whole number, (iv) natural number, (b) What is the name of the class?, , static a,b;, while(a > b+), , (i) System.out.println, (a) a-0 b-0, , i) static void main(), ii) public, iv) class fElse, , b) a-0 b0, (c) a=1 b=1, (d) none of the mentioned, 54. Which of the following loops will execute the, body of loop even when condition controlling the, loop is initially false?, (a) do-while, (b) while, , 57., , Concerning, answer, , the, , the, , program code, that follow:, , questions, , given, , publicclass LeapYear, public static void main(Stringll args), int year-2020;, , if((year % 4 ==0) && (year % 100=0), , % 400-0)), , (c) for, , (d) None of the mentioned, , ystem.out.println("LEAP YEAR, , 55. Identify how many times the loop will run?, , for(digit=0;digit < 9; digit++), , elsel, , intln("COM, System.out.print, , MMON, , digit digit *2;, digit--;, =, , (a) What will be the, , output?, , YEA
Page 66 :
Statements, Scope, , 325, , odd or even, (i) checking the number is, or c o m m o n, (11) checking the year is leap year, , () LEAP YEAR, , i) COMMON YEAR, (ii) WHOLE number, , year, , divisible by 4 o r 400, (iii) checking number is, 4, (iv) giving remainder after dividing by, , (iv) NATURAL number, , this program is, /b) What, , |, , doing?, , Answers, 9. (c) Both C and C+ style, , Multiple choice questions, , 10. (b) FALSE, 11. (c) IF or ELSE IF, , 1. (b) switch, , Explanation:, , Use the switch statement to select, , 12. (b) TRUE, , code blocks to be executed., one of many, , 13. (a) FALSE, , Syntax, , 14. (b) TRUE, , Switch(expression) {, , 15. (b) TRUE, , case x:, , 16. (d) All, , l/ code block, , 17., , break;, , are, , executed., , 19. (d) All, , / code block, , 20. (c) 128, 21. (c) Compiler error, , break;, , Explanation: Compile Time Errors are those, which prevent the code from running because of, semicolon at, an incorrect syntax such as a missing, the end of a statement or a missing bracket, class, errors, , default, l code block, 2. (a) if(), , Explanation: Use, block of Java code, , not, , a, the if statement to specify, is, condition, to be executed if a, , true., , found,, , etc. These, , spot and rectify, , kind of, , because the, , easy to, compiler finds, , errors are, , java, , them for you., 22. (c) Compiler error, , 3. (a) do-while, , Explanation: Compile Time Errors are those errors, , variant of the, , Explanation: The do/while loop is a, code block, while loop. This loop will execute the, condition is true, then, once, before checking if the, is, as the condition, it will, repeat the loop as long, , which prevent the code from running because of, an incorrect syntax such as a missing semicolon, , at the end of a statement or a missing bracket,, , class not found, etc.These kind of errors are easy, , true., , to spot and rectify because the java compiler finds, , 4. (d) continue, , them for you., , statement breaks one, Explanation: The continue, condition, teration (in the loop), if a specified, in, iteration, the next, and continues with, , OCCurs,, , the loop., , two, , Both IF and ELSE blocks, , 18. (d) None, , case y:, , 5., , (d), , case, , constants, , in the, , same, , switch, , can, , have identical values, , (C) Compiler e r r o r, 25. () Compiler error, , 24., , 26., , (c) Selection, Explanation: Selection statements allow you to, control the flow of program execution, on the, , (d) ALL, , 7. (a) boolean, 8. (b) conditional, , Xplanation: Use else if to specify, , 23. (c) Compiler error, , condition, a new, , O test, if the first condition is false, , basis of the outcome of an expression or state, of a variable, known, during runtime. Selection, statements can be divided into the, following, , categories: The if and if-else statements. The ifelse statements.
Page 67 :
326, , IsC, , CHAPTERWISE, , MCQs, , 27. (c) if, else, , (Computer Science) X, Match the following, , 28. (d) All, , 29. (d) All, , 44. (a) 1-(ii), 2-(6i), 3-(iv), 4-(ii), , 30. (d) All, , 45. (a) 1-ii), 2-(1), 3-(iv), 4-(ii), 46. (a) 1-(i), 2-6i), 3-(iv), 4-(iii), , 31. () hasNext(), 32. (c)TreeMap, , 47. (a) 1-(ii), 2-(i), 3-(iv), 4-(ii), 48. (a) 1-(i), 2-6i), 3-(iv), 4-(ii), , 33. (d) do-while, , Fil in the blanks, 34., , (c), , enum and, , 35. (c) JDK 7, , String, , Programming based questions, 49. (d) byte and char, 50. (b) YES, , 51. (d) 3, , 36. (b) TEN, , 52. (b) 25, , 37. (b) LION, , 53. (a) a-0 b=0, , 38., 39., , 40., 41., , (d) Compiler error, (b) break keyword, (a) To define ranges., (a) for ( int, , 42. (c) exit(), , 43. (a) short, , i, , 54. (a) do-while, 55. (a) Infinite, , 56., , (a) (i) odd number, , 57., , (b) (iv) class IfElse, (a) (i) LEAP YEAR, , =99; i>=0; i/9), , b) (ii), , checking, year, , the year is, , leap year or com
Page 68 :
Chapter, , Methods, , 9, 11., , utiple choice questions, , Identify, , a, , only, , method that is defined, , once in a, , program?, method, 1, All Java, , have, , shoule, , return, , a, , (c) static method, , (TRUE/FALSE), , (b) FALSE, , a)TRUE, , TRUE or FALSE) We, class, , method as the, , can, , have, , of Java, , same name, , name can contain, , (b), , numbers, , from 2nd, , java. (TRUE / FALSE)., , the identifier for, 4. What is, , method, , a, , name, , in, , the, , Java?, , can not, declared inside a method, 5. Local variable, initialization., without its, be used in expressions, , (TRUE/FALSE)., all instances of, 6. Static-method is shared among, , (a) TRUE, never, , allow, , FALSE), What is the, , return, , class, , methods defined in, , public, , allotted memory for, , the class, , statements, , given, , best defines, , the features, 14. Which of the, , given statements are, , incorrect, , ?, , abstract method must, , be declared abstract, , (b), , Abstract class defines, , FALSE, , that does not, a method, , type of, , only, , the, , structure, , of the, , (d), , (c)void, T h e process, , of defining, , class which, , are, , more, , than, , one, , differentiated Dy, , method, , ne, , signatureis:, (a) Function overriding, , be initiated, , (d), , Abstract class, , can, , be inherited, , packages contains, , 16. The, , syntax, , keyword?, , (b) java.util, , of abstract class in java is, , (a) abstract A{}, , (b) abstract class A, , (c) abstract class A}, , (d) abstract class A[], , (b) Program complexity, , mentioned, name, , as, , class:, of it's, , (c) Idealized interface, , same, , (a) finalize, (c) class, , abstract, , (d) java.system, , (java.io, , (a) Class usage, , (c) Function doubling, , 10. The method having:, , can, , 17. Identify the main advantage of abstraction., , (6) Function overloading, , (d) None of the, , Abstract class, , (a) java.lang, , double, , by n e w operator, , (c), , 15. Which, , (b) float, , (a) int, , a, , a, , are, , data, (c) Hiding the important, , (TRUE, , methods., , return any value?, , in, , the class, , class not its implementation, (b), , (a) TRUE, d., , allotted memory for, , be made, , (a) Every class containing, , FALSE, , nesting of, , are, , (a) Hiding the implementation, data, (b) Showing the important, , a, , class. (TRUE/ FALSE), (b), , class, , and showing only, (d) Hiding the implementation, , (b) FALSE, , (a) TRUE, , a, , method must, , 13. Which of the, abstraction?, , (d) 3_click, , (c) *show$, , private method, , variables defined in, , (d) All object of, , (b) Shide, , (a) 1show, , (d), , it can be accessed, Ifa function is defined public, inheritation, by object of other class by, , (c) main(), , (b) FALSSE, , (a) TRUE, , . Java, , (a) All object of, the all the, , b) FALSE, , 3, A method, in, character onwards, , finalize method, , 12. Choose an incorrect statement?, , name., , (a) TRUE, , (b), , (a) main method, , type., , (b), (, , d, , ), , (d) Unstable interface, , delete, c, , o, , n, , s, , t, , r, , u, , c, , t, , o, , r
Page 69 :
328 | ISC CHAPTERWISE MCQs, (Computer Science)-, , XIu, , 18., , apply, , The, , program, , element, , where, , we, , can, , pno, hone, is having, any compone, (motherboard, camera, sensors). If thee, , 25. A, , abstraction is, (a) Control and data, (b) Only data, (c) Only control, (d) Classes, , ph, , component, , 19. What is the element that, , can, , be viewed, , as, , combination of abstraction of data and code?, , 20., , functioning of phone, , represents all the, , shows the display only, and the, represented as a whole, which, have highest level of abstraction?, (a) Motherboard, , (b) Display, , (c) Camera, , (d) Phone, , 26. Which is not a level of abstraction?, , (a) Class, , (b) Object, , (c) Inheritance, , (d) Interfaces, , (b) Physical level, (d) External level, , (a) Logical level, , (c)Viewlevel, , Abstraction principle includes:, , 27. What is the, , (a) Use abstraction at its minimum, , advantage, , of, , higher degre, , abstraction?, , (b) Use abstraction to avoid longer codes, , (a) May get unsafe, , (c) Use abstraction whenever possible to avoid, , (b) May reduce readability, , duplication, , (c) Can be safer, , (d) Use abstraction whenever possible to achieve, , (d) Can increase vulnerability, , OOP, , 21. Higher the levels of abstraction, higher are the, , details, (a) True, , 28. Which keywords are used to define an as, class?, , (b) False, , 22. Difference, , between, abstraction is :, , Encapsulation, , and, , (a) abst, , b) abstract, , ()Abstract, , (d) abstract class, , 29. Which element is not abstract?, , (a) Binding and Hiding respectively=, , (a) Thread, , (b) Hiding and Binding respectively, , (b) AbstractList, , (c) Can be used any way, , (c) List, , (d) Hiding and hiding respectively, , (d) None of the Mentioned, , 23. How can we call abstraction in terms of stream, , 30. Aclass inheriting an abstract class does not&, , and files?, , all of its, , (a) Abstraction is called a stream and device is, called a file, , (a) Abstract, , (b) Abstraction is called a file and device is called, , (c) Static class, , function,, , It is known as., , (b) A simple class, , a streamn, , (d) None of the mentioned, , c) Abstraction can be called both file and stream, (d) Abstraction can't be defined in terms of files, , Fill in the blanks, , and stream, , 24. Where will be the abstraction used if two classes, , 31. We, , can, , compare java methods to, , combine some private data members and have, , language., , public member functions to access and manipulate, , (a) structure, , (b) union, , ()function, , (d) enum, , those data members?, , (a) Using, , private, , access, , specifier for data, , 32., , into a method., , members, , (b) Using class concept with both data members, , (a) if statement, , and member functions, (c), , Using public member functions, manipulate the data members, , (d) Data, used, , should be added, , is not sufficient to decide what is, , and, , beine, , 33., , Combination, signature., , ructor toan, , a, , constructor, (6) static, , (c) return type, to access, , to, , (d), , of, , (a) Return type, (c) Argument List, , semicolon, , becomes Jv, , (b) Methodna, of, (d) All, , the
Page 70 :
Methods| 329, name, , +art, , in, , with a, , 42. Match the columns:, , method, meti, , Group A, , Start, , Group B, , cannot, , (b) # (pound), , Ne, , a)mumber, , (d) All, , -hrphen), ne, , we, , we, , c, an, n, ca, , use, (b) Underscore (), , Method, , n, , ja), Alphabet, , 3., , All of the above, , (d), , ) Dollar(5), , variable., , to, , An abstract class, , 2 Abstract classes, , also, , name, , refers, , of the above, , 1., , (i), , Multilevel, , (ii), , can extend a, concrete class, , support, An abstract class, can define, , (ii) abstract, , Abstract class, , (iv), , operator, , Inner abstract, class, , "this", a, , ), G, , l, , o, , b, , a, , l, , v, , a, , r, , i, , a, , b, , l, , e, , (a) 1-(i), 2-6), 3-(iv), 4-Gii), , Method local variable, , (b) 1-(), 2-i), 3-(iv), 4-ii), ), , Instance variable, , () 1-i), 2-0), 3-(ii), 4-(iv), None, , d), , variables are, , stored, , Laal 1, , variables, , are, , in-, , stored, , memory and, , memory in, , in, , (d) 1-(ii), 2-(iv), 3-(i), 4-(ii), 43. Match the columns:, , instance, , (b) Heap, Heap, , java., a) Stack, Stack, , (d) Heap, Stack, , ) Stack, Heap, , hide the implementation, , Ne can, , Making, , ), , the programming, , 2. define abstract, , features, d) Provide better, abstraction., , 4., , (c), , (b) Logical, , () Real, , (d) Hypothetical, , abstraction., (b) Logical, , ) Real, , (d) Hypothetical, , (1), , (ii), (iii), , ), , (iv), , (c) 1-(i), 2-(i), 3-(ii), 4-iv), , (d) 1-i), 2-(iv), 3-i), 4-(ii), , Group B, , Java static variable | (i), , Pass as an, , is used to, , argument to a, , method., , 2., , "this" keyword is, , (ii), , operator, , Refer common, properties to all, , used to, , function, , objects., Instance variable, , 3. Object, , (ii), , 15, acombination of, A "this", , public abstract, , void method();, , to convert it into, , 3. Method signature, ., , method, A subclass of, , (a) 1-(i), 2-i), 3-(iv), 4-(ii), (b) 1-i), 2-(ii), 3-(iv), 4-(ii), , Group B, a method, , return type, to a constructor, , can be abstracted, , superclass, , 1., , Group A, , a, , (iii), , Group A, , Match the columns:, , . Add, , declare abstract, , 44. Match the columns:, , zch the following, , 1. Java methods, , java.lang, , a non-abstract, , Aclass is, , a) Object, , (ii), , class, , 3., , a) Object, , abstract class A, abstract void, , unfinished(); }, , programming complex, b) Make the, features, Provide m o r e number of, , AnObject is, , (i), , keyword, , complexity by, , easy, , Group B, , Group A, 1. contains abstract, , methods must, be made static, , iv), , 1-i), 2-(), 3-(iv), 4-(iii), b) 1-46),, 2-6i), 3-(iv), 4-(ii), ), 1-t1), 2-6),, 4-(iv), 91-i), 2-(iv),3-(i),, 3-(i), 4-ii), , return type,, method name, arguement list., , 4., , main(), , iv), , cannot be, declared static, , (a) 1-(ii), 2-(), 3-(iv), 4-(ii), , (b) 1-i), 2-(ii), 3-(iv), 4-(ii), () 1-(i), 2-6), 3-(i), 4-(iv), , (d) 1-(ii), 2-(iv), 3-(i), 4-(ii)
Page 71 :
330|, 45., , IsC, , CHAPTERWISE, , MCas, , Match the columns:, 1., , (Computer Science) -XI, , Group A, Defining two, , Group B, or, , (i), , (a) SHOW Method, , can be overloaded, , more methods, , (b) No output, , within same class, 2., , Constructors, , 4., , Methods, , (c) Compiler error, method, , (11), , overloading, , 3. Recursion, can, , (iii), (iv), , be, , added to objects, , 2, , to define behavior, , (d) None, 48., , Identify, , the, , output, , of, , Java program witha, , operator., , a method that, , public class Testing Methods4, , calls itself, , (a) 1-(ii), 2-(i), 3-(iv), 4-(i), , int cakes=5;, , (b) 1-(i), 2-(ii), 3-(iv), 4-(ii), (c) 1-(i), 2-6i), 3-(ii), 4-(iv), (d) 1-(i), 2-(iv), 3-(i), 4-(ii), , void order(int cakes), this.cakes = cakes;, , Programming based questions, public static void main(Stringll args), 46., , Identify, an, , the correct, , empty, , return, , output, , of Java program with, , statement, , TestingMethods4 t4 = new TestingMethoc, , public class TestingMethods2, , t4.order(10);, System.out.println("CAKES=" + h.eie, , void show), , System.out.println("SHOW Method.");, , (a) CAKES=5, (c) CAKES=10, , return;, , 49. Choose the, , public static void main(Stringl] args), , output, , (b) CAKES=0, (d), , of, , Compiler emur, , Java program, , public class TestingMethods5, , TestingMethods2 t2= new TestingMethods2();, , public static void main(StringlI args, , t2.show(0:, int localVariable;, (a) SHOW Method, , (b) No output, , ( ) Compiler error, , (d) None, , System.out.println(localVariable), , 47. Identify the correct output of Java program with, , )0, (b) garbage value, (c) NullPointerException, (d) Compiler error, , a void method., , public class TestingMethods3, , void show2(), , t h ., , 50., , System.out.println("SHOW Method 2"):, , public static, , void main(Stringl) args), , Testing Methods3 t3, t3.show20;, , =, , new, , TestingMethods30):, , Choose the output, local variable, , of Java progt, , public elass TestingMethodss, int cars =20;, , void change(final int cars), , cars= 10;
Page 72 :
Methods| 331, this.cars= cars;, , Dublic static, , void, , main(String|] args), , (a) only sum(10), (b) only sum(10,20), (c) only sum(10) & sum(10,20), , TestingMethods8, , t8, , =, , new, , TestingMethods8();, , (d) all of the mentioned, 53. Choose the correct output for the code., , t8.change(30);, System.out.println(t8.cars);, , abstract class Bank, , private abstract void withdraw();// Line 1, (a), , (b), , B0, , abstract void deposit(), , 20, , public void balance(){l //Line 2, , (d) Compiler error, , (c) 10, , Choose the output, , Java program, , of, , class office extends Bank{ // Line 3, , dass Road, , void deposit() 1// Line 4, , / TODO Auto-generated method stub, , static void show(), System.out.println("Inside static method.");, , (a) Compilation, , 40;, , error, , in Line 1(abstract method, , cannot be private), public class TestingMethods10, , es);, , Line, , in, , error, , (b) Compilation, , 2(abstract class, , cannot have concrete method), , public static void main(String[] args), , in Line 3(abstract class, , error, , (c) Compilation, , cannot be extended), , Road.show();, , error, , (d) Compilation, , public access modifier), , should have, 54. Will this, , method, in Line 4(deposit, , Java code with, , abstract method, , compile?, , class Puppy, a) Inside static method., b) empty message, ) Compiler error, d) Runtime error, , abstract void showName();, , / exception, , Choose the correct option for Java code, which, call to, sum() method, dlass Output, , (b) YES, , (a) NO, 55., , Choose, , the, , correct, , output of Java program, , with, , an abstract class., class, , public abstract, , publicstatic int sum(int...x), , public static, , AbstractClassTest5, , void main(Stringl] args), , System.out.println("lnside Main() method..");, , return,, a final, , Static void, , main(String args|)D, (a) No output, , sum(10);, , sum(10,20), , sum(10,20,30);, sum(10,20,30,40);, , (b), , Compiler error, , (c), , Inside, , (d), , None, , Main(), , method., , of the above, , the, 56. Regarding, the questions, , program, , code, , that follow:, , given, , below,, , answer
Page 73 :
332, , IsC, , CHAPTERWISE, , MCQs, , (Computer Science)- X, , publicclass IfElseTernary, public static, , void, main(Stringl], int number=13;, , (b) What number is given as input fo., , args)|, , //Using ternary operator, String, output=(number%2-=0)?"even, number", , :" odd, , i) 03, , i) 31, , (ii) 13, , (iv) -13, , 58. Concerning, , the, , program, , Ched, , code, , given, , answer the questions that follow, , number";, , public class Switch, , System.out.println(output);, , public static void main(String|] args), /Declaring a variable for switch ens, , (a) What will be the, , output?, , (i) odd number, , //Switch expression, , (ii) EVEN number, , switch(number), , (iii) WHOLE number, , //Case statements, , (iv) NATURAL number, , case 10: System.out.println("10");, , (b) What is the name of the class?, , break;, , ) System.out.println, , case 20: System.out.printin("20");, , i) static void main(), , break;, , (i) public, , case 30: System.out.println("30");, , iv) IfElseTernary, 57., , express, , int number-20;, , Concerning, , the program code, answer the questions that follow:, , break, , given below,, , //Default case statement, , public class PositiveNegative{, , default:System.out.println("Not in 10, 30");, , public static void main(String[] args){, int number=-13;, , ifnumber>0, System.out.println("POSITIVE");, Jelse if(number<0), , (a) What will be the, , System.out.println("NEGATIVE");, , Jelse, System.out.println("ZERO");, , output?, , i) 20, , (i) 21, , (Gii) 22, , iv) 23, , (b) Switch case can be replaced with_, i) For loop, i) Do while condition, (a) What will be the output?, i) NEGATIVE, (ii) ZERO, , (ii) If condition, , (ii) POSITIVE, , (iv) TF else condition, , iv) NONE, , Answers, Multiple choice questions, 1. (a) TRUE, 2. (a) TRUE, , 6. (a) TRUE, , 7. (a) TRUE, 8. (c) void, , Explanation:, , 3. (a) TRUE, , 4. (b) $hide, , Void: It is, , d Keyword and, a, , keywoT, , specity that a method doesn't retu, main() method doesn't return any, (b) Function, , thing, , 5. (a) TRUE, , 9., , overloading
Page 74 :
Methods | 333, , If a class has multiple methods, ame but different in parameters, it, , ation:, E, , i, , p, , l, , a, , having sanne, , 20wn, , rtorm only, the, , If, , have to, one operation, having same name, , Perto, of, , rloading., , Method, , as, , we, , (c) Using public member functions, members, manipulate the data, 25. (d) Phone, , 24., , ( d ), , c, , o, , n, , s, , t, , 27. (c) Can be safer, 28. (b) abstract, , p r o g r a m ., , a ., , r, , u, , c, , t, , Erplanation:, , o, , 29. (a) Thread, , r, , A, , in Java is, , constructor, , block of, , a, , to a method that's called when a n, Code similar, instance of an object is created. A constructor, return, , doesn't have, must be, constructor, a, , type. The, , the, , the same as, , considered, , members, , (a), , 30., , of, , name, are, , Fill in the blanks, , 31. (c) function, , not, , Explanation: A, , of a class., , collection of, , method, , 1. (a) main, method is the entry point, Explanation: Java main, is always public, of any java program. Its syntax, , together, , statements o r a, , perform, , a, , block of code, , set, , or, , of code grouped, , certain task, , like int, float, double,, , or, , operation., , a, , reference, , type, , or, , void, , can, , be, , type(returns nothing). The parameters, must be accepted, passed in a sequernce and they, , a, , by the method in the same sequence., , 33. (d) All of the above, , the features, Explanation: Data Abstraction is the property, virtue of which, , displayed, , a, , methods. A return type may be a primitive type, , 13. (d) Hiding the implementation and showing only, , to, , is, , in Java is declared, Explanation: Every method, for all java, with a retum type and it is mandatory, , class are allotted memory for, the methods defined in the class, , by, , to, , method, , 32. (c) return type, , static void main(Stringl] args) You can only, for, change the name of String array argument,, example you can change args to myStringArgs., (d) All object of, , Abstract, , of the, , name, , Unlike methods, constructors, the class., , 12., , ana, , 26. (d) External level, , increases the readability of the, , methods, , to access, , the, , essentials units, , the essential details, , only, , The trivial, , user., , are not, , displayed, by, , java, abstraction is achieved, , to, , or, , the, , the, , are, , non-, , user., , 34. (d) All of the above, , 35. (d) All of the above, 36. (c) Instance variable, , In, , refers to the, current object in a method or constructor. The, , Explanation:, , interfaces and, , abstract classes., , The this, , keyword, , most common use of the this keyword, , is, , to, , 4.(C) Abstract class can be initiated by new operator, , eliminate the confusion between class attributes, , 15. (a) java.lang, , and parameters with the same name., , Explanation:, are, , java.lang., , fundamental, , to, , the, , prOgramming language., classes, , are, , Provides, desigrn, , The, , classes, , that, , 37. (c) Stack, Heap, , of, , Java, , 38. (a) Making the programming easy, , most, , the, , important, , Explanation: Abstraction is process of hiding, implementation details and showing only, , class, Object, which is the root of the, , uerarchy, and Class, instances of which represent, , functionality. Abstraction in java is achieved by, , classes at run time., 6., (c) abstract class A{} ===, 7., (c) ldealized interface, 18. (a), Control and data, , 39. (b) Logical, , 19. (b) Object, , Match the followingg, , 20., , Use abstraction, , 21. (b), , whenever, , using interface and abstract class., , 40. (c) Real, , possible, , to avoid, , duplication, False, , 2. (a) Bindingand iding respectively, 23. 0) Abstraction is called a file and device is called, à stream, , the, the, , 41. (a) 1-(i), 2-(), 3-(iv), 4-(ii), 42. (a) 1-i), 2-(i), 3-(iv), 4-(ii), 43., , (a) 1-i), 2-(), 3-iv), 4-(ii), , ., , (a) T(u), 2-(i), 3-(iv), 4-(ii), , 45., , (a) 1-ii), 2-(), 3-(iv), 4-(ii)
Page 75 :
334, , |, , ISC, , CHAPTERwISE MCQs (Computer Science)- Xil, , Programming, , 54. (a) NOo, , 55. (c) Inside Main() method., , 46. (a) SHOW Method, 47. (a) SHOW Method 2, , 56. (a) (i) odd number, , 48. (c) CAKES=10, , 57. (a) (i) NEGATIVE, , 49., 50., 51., 52., 53., , (d) Compiler error, (d) Compiler error, (a) Inside static method., (d) all of the mentioned, (a) Compilation error in Line 1(abstract method, cannot be private), , (b) (iv) 1fElseTernary, (b) (iv)-13, 58. (a) (i) 20, , (b) (iv) IF else condition
Page 76 :
Chapter, , 10, , Arrays, 9. How do we describe an array in the best way?, , Muttiple choice questions, , (a) The Array shows a hierarchical structure., Special symbols used to declare an array in Java, is, , (c), , Container that stores the elements of similar, , (a) Braces, , types, , (b) Parentheses (), , (d), , The Array is not, , (d) Angled, , Brackets, , a, , data structure, , 10. Choose the correct way of declaring an array, , (c) Square Brackets [ ], , (a) int javatpoint[10]};, , <>, , . The special symbols used to initialize an array at, , (b) int javatpoint;, , the time of the declaration itself is, , (c) javatpoint{201;, , (a) Parentheses (), , (d) array javatpoint[10];, 11. How to initialize an array in JAVA language?, , b) Square Brackets [ 1, , () Braces (, , (a) int arrf[21-(10, 20), , (d) Angled Brackets <>, , (b) int arr(2)={10, 20, , 3. We can, , skip initializing some elements of the, , during, FALSE), , array, , Shorthand Initialization., , (TRUE/, , int arrl2] = {10, 20}, , (d) int arr(2) = (10, 20), , options, , . We can declare an array without initialization and, , (a) Elements of mixed, , data, , types can be stored., , (b) Easier to access the elements in an array, , without mentioning the size. (TRUE / FALSE), (b) FALSE, , (a) TRUE, , (c), , 12. Identify the advantage of the array from the given, (b) TRUE, , (a) FALSE, , .Default value of an element of Object type array, , (c) Index of the first element starts from 1., (d) Elements of an array cannot be sorted, 13. What is the highly used concept of an array?, , is, , (a) Binary Search tree, , (a) 0, , (b), , (c)-1, , (d) Garbage value, , null, , (b) Caching, , Default value of byte, short, int or long data type, , (a)-1, , dentify the, , 14. The disadvantage of the array is:, , (b) 1, (d), , 0, , default value, , Garbage value, , of float, , or, , double data, , 1, , a t will be, , (a) Stack and Queue data structures can be, implemented through an array., (b) Index of the first element in an array can be, , ype elements of an array in Java, , (a) 0, , () Spatial locality, (d) Scheduling of Processes, , eiements of an array in Java., , 8,, , (b) Arrays are immutable., , negative, , (b) 0.0, , (d), , (c) Wastage of memory if the elements inserted in, an array are lesser than the allocated size, , 1.0, , of, the default value, , a, , char data, , eiements of an array in Java:, , (a) 'A, , (b) ' \ 0, , (c) null, , o r null, (d) '\0', , type, , (d), , Elements, , can, , be accessed, , sequentially., , 15. What is the size of int arr[9] assuming that int is of, 4 bytes?
Page 77 :
336, , |, , Isc, , (a), , 9, , CHAPTERWISE, , McQs, , (Computer Science) XI, -, , 24. Array A[ index, , (b) 36, , (c) 35, 16. Name the, , stack?, , (d) None of the above, , process of, , inserting, , an, , element, , (a), , (d) 1, , ich auset, , 26. How, , 27. When, , in, , array, , we, , pass, , an, , array, , to, , java?, , method, a meth, , a, , receives, , (a) A copy of the array, (b) a copy of the forst elemernt, (c) the reference of the array, , (d) None of the above, 19. At which time the, , ArrayIndexOutOfBoundsException occur?, , 28., , (C) Not an error, , (d) the length of the array, Name the operators that, , (6) alloc, , (c) new, , (d) new malloc, , (a), , concepts make extensive use of arrays?, , It is, , incorrect Statement, , necessary, , to use new, , an array, , (a) Binary trees, , (6) Array, , (b) Scheduling of processes, , allc, , (a) mallooc, 29. Choose the, , (d) Not an exception at all, , is used to, , memory to array variable in Java?, , (a) Compile-time, (b) Run-time, , can, , be, , operator to inina, , initialized using co, , separated expressions surrounded by, , (c) Caching, , braces, , (d) Spatial locality, 21. Choose the best, , (), , reason to use, , arrays., , (b) Elements in an array cannot be sorted, (c) Index of first element of an array is 1, Easier to store elements of, , should avoid, , same, , data, , (c) Index value of an array can be negative, , (a) 15, , (b), , (c) 11, , (d) 60, , 19, , of, , ar, , mentioned, , Fil in the, 31., , Array, , blanks, is, , (a) Same, , arr|15];?, , time, , (c) Both Row and, Column, (d) None of the, , (d) Elements are sequentially accessed, what is the size of int, , the, , (b) Column, , implemented, , if elements inserted in an array are lesser than, the allocated size, , initialized when u, , (a) Row, , type, , wastage of memory space, , be, , mentioned, 30. What is needed to specify, initialization?, , (a) Data structure like queue or stack cannot be, , 4bytes,, , can, , (d) None of, , using arrays?, , chances of, , Array, , declared, , (a) Objects of mixed data types can be stored, , 23. If int is of, , an, , (d) none of above, , (c) Overflow, , are, , define, , (a) objects, , (b) Garbage collection, , (b) There, , can we, , (c) primitive data type, , condition where the size of the stack is, try to add the 11th element in the stack., (a) Underflow, , we, , b) sequentially, (d) logarithmical, , (a) randomly, (c) exponentially, , (b) object references, , 18. Name the, 10 and we, , Why, , arta, , access., , (d) None of the above, , 22., , an, , 25. Identify an element in an array which a., , (b) Garbage collection, (c) Overflow, , (d), , 0, , () 2, , in the, , (a) Insert, (b) Add, (c) Push, (d) None of the above, 17. Name the, condition when the user tries to delete, the element from the, empty stack ?, (a) Underflow, , 20. Which, , (first element, nt in, (b) -1, , 32., , a, , t, collection of elementsSof__data, ot-, , (b) Different, JVM, implements arrays, (a) Primitive, (b) Object, , as, , yP
Page 78 :
Arrays | 337, , 3., , i r r a y sh a v e, , default value of an (iii), , 0, , element of Object, , Names, , type array, b, , Values, , Methods, , ), N, , o, , n, , longdata type, , e, , initialization, , without, , declaration, , (a), (b), (c), (d), , 4rtay, , n e m o r y, , Does not a l l o c a t e, , Allocatesmemory, index, , starts, , 42. Match the columns:, , (b) 0, , 1., , with, , variable can start, , Group B, , Group A, , (d) Any integer, ameof an array, , 1-ii), 2-(6), 3-(iv), 4-(ii), 1-(i), 2-(ii), 3-(iv), 4-(iii), 1-(i), 2-(i), 3-(ii), 4-(iv), 1-(i), 2-(iv), 3-(i), 4-(ii), , with, , 4 array, , default value of, , a, , (i), , similartypes, 2., , b)Underscore (_), , array, , (ii), , d) All, is called, , () 1-(i), 2-(i), 3-(ii), 4-(iv), (d) 1-(ii), 2-(iv), 3-(), 4-(ii), , Multidimensional, , 43. Match the columns:, , d) Multi-value, 1., , Advantage of the, , a) N4-1, , (b) N, , y, , ) N+1, , (d) 10*N, , Highly uses the, , Column, , b)0, , )1, , (d) 2, , dimensional, , array, , is, , an, , in, , digit., , (b) 3, , 92, , (d) 1, , example, , Disadvantage of, , (iii), , 36, , Size of int arr[9J, , (iv), , Wastage of, memory, , (a) 1-(ii), 2-(i), 3-(iv), 4-(ii), (b) 1-), 2-(i), 3-(iv), 4-(ii), (c) 1-(ii), 2-(i), 3-(ii), 4-(iv), (d) 1-(ii), 2-(iv), 3-(i), 4-(ii), 44. Match the columns:, , Group B, , Group A, 1., , Group A, , Group B, i), , inserting an, , delete the element, , from the empty, Square Brackets, , Undertlow, , (ii), , Push, , Stack, , 2., , (ii), , (i), , element in the, , Braces, , array, , array, , the elements, , of, , Match the columns, , toinitialize an, , Easier to access, , array, 3., , 4., , ch the following, , special symbols, used to, declare an, , (ii), , the array, , Oimensional arrays., )4, , Spatial locality, , concept of an, , number, , MUitdimensional array starts with, , a)-1, , (i), , array, , a, , and, , Group B, , Group A, , number ot, , dimension N contains, , subscripts or brackets?, , ay, , null, , (b) 1-i), 2-(i), 3-(iv), 4-(i), , b) Combo, , Row number, , or, , (a) 1-(i), 2-(i), 3-(iv), 4-(ii), , array., , Bidirectional, , Aay of, , \0, , 3. declaring an array | (iii) int arr[2] = {10, 20, 4. initialize an array iv) int javatpoint[10];, , DollarSymbol ($), Hayof arrays, , stores the, , elements of, , char data type, , a) A letter, , e, , null, , byte, short, int or, , ), d, , (iv), , default value of, , and F, Fields, ie, and, , stack
Page 79 :
338 |, , IsC, , 3., , CHAPTERWISE McQs (Computer, , size of the stack, is 10 and we, , (iii), , Science)- XIl, , run time, , 48. Choose the correct output of Java codo., , to add the 11th, , System.out.print(balls.length);, , element in the, , stack, 4., , Array Index, , (iv), , Out of Bounds, , Overflow, , 45., , (d) Compiler erog, , i), , arrays, , (c) WHITE, , Easier to store, , (d) Compiler error, 50., , 1i), , Spatial locality, , (iii), , 0, , Choose the correct output, , Java, , program, , public class Polo, , public static void main(String args[l), Stringl] computer = ('"RAM""HDD","MOUE, , arrays, Index of the first, , Stringll parts computer[0],computer, , (iv) chances of, , element in an, , wastage of, , array, , memory space, , System.out.print(parts[1]);, , (a) 1-(ii), 2-6), 3-(iv), 4-(ii), (b) 1-6), 2-(ii), 3-(iv), 4-(i), () 1-(i), 2-i), 3-(ii), 4-(iv), , (a) RAM, , (d) 1-(i), 2-(iv), 3-i), 4-(ii), , 51., , output, , for, , (b) HDD, , (c) MOUSE, (d) Compiler eror, Choose the correct output of Java, progra", int, , Programming based questions, 46. Choose the correct, , of, , arrays, , arrays, , 4., , program, , (b) YELLOW, , elements, , Disadvantages of, , Java, , (a) RED, , Group B, , extensive use of, , 3., , of, , output, , System.out.print(colors[2]);, , Group A, Advantages of, , (c)1, , v, , Stringl] colors ("RED";"YELLOW""WHT, HITE, , Match the columns:, , 2., , (b) -1, , arrays, , 1-(ii), 2-(i), 3-(iv), 4-(ii), 1-4), 2-(ii), 3-(iv), 4-(i), 1-(i), 2-(6), 3-(ii), 4-iv), 1-i), 2-(iv), 3-(i), 4-(ii), , 1., , (a) o, , 49. Choose the correct, , Exception occur at, (a), b), (c), (d), , code snippe, , int|] balls- {l;, , try, , ages[3] {25, 27, 30), -, , System.out.println(ages[1]);, , Java code snippet, , with arrays, , (a) 25, , (b) 27, , (c) 30, , (d) Compile error, , 52. When index of an element is N, what wyill *, , static int[] numS, , public static void main(String args[l), , System.out.printin(nums.length);, (a) 0, , 53., , actual position in the, array, (a) N-1, (b) N, (c) N+1, (d) N+2, Choose correct, for the, , output, #include <stdio.h>, , code, , int main(), , (b) null, (c) Compiler error, , int arr|5={10,20,30,40,50};, , (d) Runtime Exception Null Pointer Exception, , 47. Choose the correct output of the below Java, , system.out.print("%od", arr|5), return 0;, , programn, int[] marks = {35,65,95;, , (a) Garbage value, , System.out.print(marks.length + "," + marks[1);, , (a) 2,65, , (b) 3,95, , (c) 3,65, , (d) Compiler error, , (b) 10, , (c)50, (d) None of the, above
Page 80 :
Arrays| 3339, the program, erence, , code, , given below,, , fact-facti;, , stions tthat, h a t follow:, , questions, , e rthe, y t b l i c, c, , l, , a, , s, , System.out.println("Factorial of "*number+" is:, , s P, , r, , i, , m, , e, , "+fact);, void main(S, , args|1), , b l i cs t a t i c, , (a) What will be the output?, t i,m=0,flag=0;, , n-3://it is, int, , the, , number, , to, , be checked, , (i) Factorial of 5 is: 120, , (ii) Factorial of 5 is: 121, (ii) Factorial of 5 is: 122, , m=n/2;, , if(n=0lIn==1), not, , is, , Svstem.out.printin(n*, , prime, , a, , (iv) Factorial of 5 is: 123, (b) What is the name of the class?, , number");, , (i) System.out.println, , Jelse, , (i) static void main(), , for(i-2;i=m;it+){, , (ii) Factorial, , itinoi=0){, System.out.println(n+", , not, , 1s, , prime, , a, , (iv) Factor, , 56. Concerning the program code given below,, , number");, , answer the questions that follow:, , flag=l;, , class Palindromel, , break;, , public static void main(String args[1{, int r,sum-0,temp;, int n-454;://t is the number variable to be checked, , iflag-0), , System.out.println(n+" is prime, , number"); }, , for palindrome, , temp-n;, , V/end of else, , while(n>0), -n%10; l/getting remainder, , sum=(sum*10)+r;, , What will be the, , output?, , n=n/10;, , ) 3 is a prime number, () 2 is a prime number, , if(temp-sum), , ), , 4 is, , a, , System.out.println("palindrome number ");, , (iv), , 5 is, , a, , prime number, prime number, , else, , nat will be the output if the number entered, , System.out.println("not palindrome"), , 0) 45 is a, prime number, ) It is a, prime number, 31) n is not a, prime number, ) 45 is not a, , (a) What will be the output?, , is 45?, , uncerning the, er, the, , ), , prime number, program code, , questions, ass Factoriall, , (ii) not palindrome, ven, , below,, , that follow:, , (b) What is the class Palindrome doing?, , C static void main(String, argsl), , t, , is the, , =l;jc=numberit+)\, , mber, , (ii) Palindrome, , (iv) 454, , A ifact 1,, , atorinumber-5;, al /|It, , palindrome number, , to, , calculate, , (i) Checking number is prime or not, (i) arranging number is ascending order, , (ii) checking number is Palindrome or not, (iv) none of the above
Page 81 :
340, , |, , IsC, , CHAPTERWISE, , MCas, , (Computer Science)- XIu, , Answers, , Multiple choice questions, , 32. (b) Object, 33. (c) Methods and Fields, , 1., , (), , 2., , (c) Braces {}, , Square Brackets [], , 34. (a) Does not allocate, , Explanation: syntax: int|| myArray ={131., , 3. (a) FALSE, , 3,14, , 35. (b) 0, , 4. (a) TRUE, , Explanation:, , 5. (b) null, , The first, , element of, , an, , index 0, and the last element is at the array, inde, equal to the value of the array's, , 6. (c) 0, 7. (b) 0.0, , length proe, , minus 1., , 8., , (d) '\0', , 9., , (c) Container that stores the elements of similar, , or, , null, , 36. (d) All, , types, (a) int javatpoint[10];, 11. (c) int arr[2] {10, 20), 12. (b) Convenient to access the, elements in an array, 10., , 37. (c) Multidimensional, , 38. (b) N, , 39. (b) 0, , =, , 13. (c), , 14., , (c), , Spatial locality, Wastage of memory if the elements inserted in, an, , array, , are, , lesser than the allocated size, , 40. (b) 3, , Match the following, 41. (a) 1-(b), 2-(a), 3-(d), 4-(c), , 15. (b) 366, , 42., , 16. (c) Push, , 43., , 17. (a) Underflow, , 44., , 18. (c) Overflow, , 45., , (a), (a), (a), (a), , 1-(b), 2-(a), 3-(d), 4-(), 1-(b), 2-(a), 3-(d), 4-(c), 1-b), 2-(a), 3-(d), 4-(c), 1-(b), 2-(a), 3-(d), 4-(c), , 19. (b) Run-time, 20., 21., 22., , (d) Spatial locality, (d) Easier to store elements of same data type, (b) There are chances of wastage of memory space, if elemernts inserted in, the allocated size, , an, , array, , are, , lesser than, , 23. (d) 60, , Programming based questions, 46., 47., , -, , 48. (a) 0, , 49. (d) Compiler error, 50. (c) MOUSE, , 24. (a) 0, , 51. (d) Compile error, , 25. (a) randomly, , 52. (c) N+1, , 26. (a) objects, 27. (c) the reference of the array, 28. (c) new, , 53. (a) Garbage value, , 54., , (a) (i), , 55., , (a), (b), (a), (6), , 29. (a) It is necessary to use new operator to initialize, an array, , 30. (a) Row, 56., , Fill in the blanks, 31. (a) Same, Explanation: An array in Java is a set of variables, , referenced by using a single variable name, combined with, , (d) Runtime Exception Null Pointer Excepte, (c) 3,65, , an, , index number., , 3 is, , prime number, (b) (iv) 45 is not a prime number, a, , (i) Factorial of 5 is: 120, (ii) Factorial, (i) palindrome number, , (ii) checking number is Palindrome, , o rn d