You are on page 1of 17

Exam/R12/Module-I/IPL MCQ

Module 1 Introducing the programming Chapter 06: Using Compound Assignment and Iteration Statements Q1. Consider the following statement remainder remainder !n whi"h one is e#ui$alent to the a%o$e ex&ression '. remainder ! n (. remainder ! n C. remainder n! ). remainder !n Answer: B [ age !0"!1# Q2. *hi"h of the following in"rements a $alue %+ one, '. -(. -1 C. 1-l ). .'nswer/ ' 0&age 112 Q3. *hat is a sentinel $aria%le, '. 4his $aria%le whi"h "hanged inside the loo& (. 4he $aria%le whose $alue "auses a loo& to exit earl+ C. 4he $aria%le in a loo& "ontrols the num%er of iterations that it &erforms ). 5one 'nswer/ C 0&age 122 Q6. 7ow man+ times the loo& will re&eat, for8int i 19 9i--: ; //"ode < '. = (. 1 C. 4his loo& will ne$er terminate ). 4his loo& will not "om&ile 'nswer/ C 0Page 122 Q>. 7ow man+ times the loo& will re&eat, for8int i 19 9i--: ; //"ode if8i 1=: %rea?9 < '. = (. 1 C. 1= ). 4his loo& will not "om&ile 'nswer/ C 0Page 122 Q@. *ill the following loo& "om&ile, for8 9 9 : ; < '. Aes (. 5o 'nswer/ ' 0Page 12. Aou must ma?e the loo& to terminate somehow2 QB. *hat will %e the out&ut the following loo&, for8int i 19 iC 39 i--: ; if8i 2: %rea?9 Console.*rite8 i - D D:9 < '. 1 2 3 (. 1 2 C. 1 ). 1 3
7a%i% (I4L 1

Exam/R12/Module-I/IPL

'nswer/ C 0Page 112 Q1. *hat will %e the out&ut the following loo&, for8int i 19 iC 39 i--: ; if8i 2: "ontinue9 Console.*rite8 i - D D:9 < '. 1 2 3 (. 1 2 C. 1 ). 1 3 'nswer/ ) 0Page 112
MCQ

Module 1 Introducing the programming Chapter 0$: Managing %rrors and %&ceptions Q1. CE ma?es it eas+ to se&arate the error handling "ode from the "ode that im&lements the main flow of the &rogram %+ FFFFFFFFFFFFFFFFFFFFFFFFF. E. using ex"e&tions and ex"e&tion handlers G. using "he"?ed and un"he"?ed o&erations H. using error handler 7. none Answer: A [ age '!# Q2. *hat is the &ur&ose of "at"h handler in an ex"e&tion handling me"hanism, '. to "at"h and handle a s&e"ifi" t+&e of ex"e&tionI (. to &re$ent &rogram from "rushing C. to re&ort a%out errors to runtime ). to tra& data loss 'nswer/ ' 0&age 112 Q3. *hat ha&&ens if an+ statement inside a tr+ %lo"? generates error, '. 4he runtime throws an ex"e&tion and transfers "ontrol to the finall+ %lo"? (. 4he runtime throws an ex"e&tion and transfers "ontrol dire"tl+ to the first mat"hing "at"h handler C. 4he runtime throws an ex"e&tion and sto&s the exe"ution of &rogram ). 4he runtime throws an ex"e&tion and transfers "ontrol to error routine 'nswer/ ' 0&age JJ2 Q6. *hi"h of the following is or are $alid, E. tr+ ; //.. < "at"h ; //... < G. tr+ ; //.. < finall+ ; //... < H. tr+ ; //.. < "at"h8In$alidCastEx"e&rion ex1: ; //... < "at"h8Ex"e&rion ex2: ; //...
7a%i% (I4L 2

Exam/R12/Module-I/IPL

7.

< finall+ ; //... < tr+ ; //.. <

"at"h8Ex"e&rion ex2: ; //... < "at"h8In$alidCastEx"e&rion ex1: ; //... < finall+ ; //... < 'nswer/ 'I (I ) 0C in"orre"t. 5arrower t+&e ex"e&tions must %e %efore %roader t+&e2 Q>. *hat ha&&ens if a try %lo"? throws an ex"e&tion and there is no "orres&onding catch handler, '. 4he runtime exe"utes its own error routine and exe"utes next statement (. 4he runtime exits the tr+ %lo"? and tries to exe"ute statement immediatel+ after the tr+ %lo"?. C. 4he &rogram terminates with an unhandled ex"e&tion ). 5one of the a%o$e 'nswer/ C 0Page 1==2 Q@. Consider the "ode %lo"? "he"?ed ; int will4hrow num%er--9 < what will ha&&en when the "ode exe"utes, E. K$erflowEx"e&tion will %e thrown G. $alue of num%er will %e trun"ated H. "ode will not "om&ile 7. none 'nswer/ ' 0Page 1=B2 QB. Consider the "ode %lo"? un"he"?ed ; int will4hrow num%er--9 < what will ha&&en when the "ode exe"utes, '. K$erflowEx"e&tion will %e thrown (. $alue of num%er will %e trun"ated C. "ode will not "om&ile ). none 'nswer/ ( 0Page 1=B2 Q1. 4he throw statement needs FFFFFFFFFF o%Le"t to throw. E. an ex"e&tion G. an error H. a M+stem.o%Le"t t+&e 7. ' dis&osa%le t+&e 'nswer/ ' 0Page 122 QJ. 'll integer arithmeti" in a FFFFFF statement alwa+s throws an K$erflowEx"e&tion. '. "he"?ed (. un"he"?ed C. loo& ). de"ision 'nswer/ '
7a%i% (I4L 3

Exam/R12/Module-I/IPL

0Page 1=B2 Q1=. *hi"h t+&e of o$erflow ex"e&tion is "he"?ed inside a "he"?ed %lo"?, '. Knl+ floating &oint arithmeti" (. Knl+ integer arithmeti" C. Knl+ sta"? o$erflow ). 'll of the a%o$e 'nswer/ ( 0Page 1=B2 Q11. *hat ha&&ens if an+ statement inside a "he"?ed %lo"? is a method "all, '. "he"?ing a&&lies to "ode that runs in the method that is "alled (. "he"?ing does not a&&l+ to "ode that runs in the method that is "alled C. CE does not allow method "all inside a "he"?ed %lo"? ). 5one of the a%o$e 'nswer/ ( 0Page 1=B2 Q12. 'll integer arithmeti" in an FFFFF %lo"? is not "he"?ed and ne$er throws an K$erflowEx"e&tion. '. "he"?ed (. un"he"?ed C. loo& ). de"ision 'nswer/ ( 0Page 1=B2 Q13. *hi"h data t+&e is "he"?ed for o$erflow inside a "he"?ed %lo"?, '. int (. long C. float ). dou%le 'nswer/ 'I ( 0Page 1=B2 Q16. Aou "an use the "he"?ed and un"he"?ed ?e+words to "ontrol floating-&oint 8non-integer: arithmeti". '. 4rue (. Galse 'nswer/ ( 0Knl+ integer arithmeti". Page 1=B2 Q1>. *e "an throw an ex"e&tion %+ using the FFFFFF '. raiserror method of the o%Le"t "lass (. throw statement C. "he"?ed statement ). un"he"?ed statement 'nswer/ ( 0&age1=J2
MCQ

Module 1 Introducing the programming Chapter 0!: Creating and Managing Classes and ()*ects Q1. FFFFFFFFFF &ro$ide a "on$enient me"hanism for modeling the entities mani&ulated %+ a&&li"ations. E. ClassesI G. K%Le"ts H. 5ames&a"es 7. Enumerations Answer: A [page 116# Q2. *hat do +ou do when +ou design a "lass, '. +ou s+stemati"all+ arrange information into a meaningful entit+I (. +ou grou& information for glo%al a""ess C. +ou &rote"t +our information from %eing altered ). +ou write statemnts to mani&ulate information from data%ase Answer: A [page 116# Q3. En"a&sulation is sometimes referred to as FFFFFFFFFFFFFFFF E. &ol+mor&hism G. a%stra"tion H. grou&ing 7. information hiding Answer: + [page 116# Q6. *hat are the &ur&oses of en"a&sulation,
7a%i% (I4L 6

Exam/R12/Module-I/IPL

I. 4o "om%ine methods and data inside a "lass N. 4o "ontrol the a""essi%ilit+ of the methods and data O. 4o &rote"t data from mali"ious use L. 4o hide o%Le"ts from a&&li"ations 'nswer/ 'I ( 0Page 11@2 Q>. *hi"h ?e+word is used to "reate new instan"e of a "lass, E. "reate G. o&en H. new 7. o%Le"t Answer: C [ age 11$# Q@. ' method or field in a "lass is said to %e FFFFFFFFFFF if it is a""essi%le onl+ from inside the "lass. '. &u%li" (. &rote"ted C. internal ). &ri$ate 'nswer/ ) 0Page1112 QB. ' method or field in a "lass is said to %e FFFFFFFFFFF if it is a""essi%le from inside the "lass and su%"lasses of the "lass. '. &u%li" (. &rote"ted C. internal ). &ri$ate Answer: B [ age11!# Q1. ' method or field in a "lass is said to %e FFFFFFFFFFF if it is a""essi%le %oth from inside and outside the "lass '. &u%li" (. &rote"ted C. internal ). &ri$ate Answer: A [ age11!# QJ. ' method or field in a "lass is said to %e FFFFFFFFFFF if it is a""essi%le %oth from outside the "lass %ut within the same assem%l+. '. &u%li" (. &rote"ted C. internal ). &ri$ate Answer: C [ age11!# Q1=. *hi"h of the following is or are true a%out "onstru"tors, '. ' Constru"tor is a s&e"ial method "alled automati"all+ when a new instan"e of the "lass is "reated (. ' "onstru"tor has the same name as the "lass C. ' "onstru"tor has no return t+&e ). ' "onstru"tor "annot ta?e &arameters Answer: A, B, C [+ incorrect- Constructors can ta.e parameters- age 11'# Q11. *hat ha&&ens if +ou do not write an+ "onstru"tor for +our "lass, '. Aou "annot "reate o%Le"ts from the "lass (. Aou "lass does not "om&ile C. Com&ilers generate a default "onstru"tor for +ou ). Aou "lass is treated as a stru"ture Answer: C [ age 11'# Q12. Constru"tors do not su&&ort o$erloading. '. 4rue (. Galse Answer: B [/e0erse is true, page 110# Q13. *hi"h of the following is or are true a%out stati" mem%ers, '. stati" mem%ers are "lass mem%ers rather than o%Le"t 8instan"e: mem%er (. 4o a""ess stati" mem%erI +ou do not need to "reate o%Le"t C. stati" mem%ers are shared ). Knl+ one "o&+ of a stati" mem%er is "reated irres&e"ti$e of how man+ o%Le"t is "reated Answer: A, B, C, + [page 11'"120# Q16. ' stati" "lass "an "ontain %oth stati" and non-stati" mem%ers. '. 4rue (. Galse Answer: B [A static class can contain onl3 static mem)ers- age 121#
MCQ

7a%i%

(I4L

>

Exam/R12/Module-I/IPL

Module 1 Introducing the programming Chapter 0': Understanding 4alues and /e5erences Q1. *hi"h of the following is 5K4 a $alue t+&e,. I. intI N. (oolean O. string L. Char Answer: c [page 126# Q2. Consider the method 0oid Change4alue6 int i 7 8 i99: ; 5ow "onsider the following statements int a<10: Change4alue6 a 7: Console-=rite>ine6 a 7: *hat is the out&ut, E. = G. 1= H. 11 7. null Answer: B [page 126# Q3. Palue t+&es are some time "alled FFFFFFFFFFFFFFFF I. dire"t t+&e N. indire"t t+&e O. stru"tures L. enumerations Answer: A [page 126# Q6. Referen"e t+&es are some time "alled FFFFFFFFFFFFFFFF '. dire"t t+&e (. indire"t t+&e C. stru"tures ). enumerations Answer: B [page 126# Q>. Consider the statement M+stem.*indows.Gorms.4ext(ox t9 *hat $alue does the referen"e t hold, I. em&t+ N. = O. null L. nothing Answer: C [ age 126"12!# Q@. Consider the two statements Mtatement I: int i<null: Mtatement II/ ()*ect o < null: 5ow whi"h statement or statements are $alid, E. Mtatement I G. Mtatement II H. (oth Mtatement I and Mtatement II 7. 5either of the two Answer: B [ age126"2!, null "an %e assigned to referen"e t+&es onl+ (ut CE 2.=- su&&orts nulla%le t+&eI +ou ma?e $alue t+&e nulla%le 4he "ode will loo? li?e %elow int, i null92 QB. Consider the "ode sni&&et static 0oid +o=or.6out int param7 8 param99: ; *ill this "om&ile, E. Aes G. 5o Answer: B [ age1?1 to 1?@ 4he method must assign $alue to out &arameters#
7a%i% (I4L @

Exam/R12/Module-I/IPL

Q1. Con$erting a $alue t+&e into referen"e t+&e is "alledFFFFFF E. "asting G. ex&li"it "asting H. %oxing 7. un%oxing Answer: C [ age1?!# QJ. Con$erting a referen"e t+&e into $alue t+&e is "alledFFFFFF '. "asting (. ex&li"it "asting C. %oxing ). un%oxing Answer: + [ age1?!#
MCQ

Module 1 Introducing the programming Chapter 10: Creating 4alue A3pes with %numerations and Structures Q1. CE allows "reating two user defined $alue t+&es. 4he+ are/ M. "lasses 5. o%Le"ts K. stru"tures P. enumerations Answer: C, + [page 1@?# Q2. Enumeration $aria%le li$e on FFFFFFFFFFF I. the sta"? N. the hea& O. unmanaged memor+ L. none of the a%o$e Answer: A [page 1@@# Q3. Qnderl+ing t+&e of an enumeration is alwa+s FFFFFF M. integral t+&e 5. floating t+&e K. string t+&e P. referen"e t+&e Answer: A [page 1@@, )3te, s)3te, short, ushort, int, uint, long or ulong- +e5ault int# Q6. Qnderl+ing t+&e of an enumeration defaults toFFFFFFF '. short (. int C. long ). float Answer: B [page 1@@# Q>. FFFF is li?e a "lass %ut is a $alue t+&e. M. 'n enumeration 5. ' delegate K. 'n e$ent P. ' stru"ture Answer: + [ age 1@'# Q@. Aou "an use o&erators su"h as the e#ualit+ o&erator 8 : and the ine#ualit+ o&erator 8R : on +our own stru"ture t+&e $aria%les sin"e the+ are $alue t+&es. I. 4rue N. Galse Answer: B [ age161, +ou "annot use o&erators su"h as the e#ualit+ o&erator 8 : and the ine#ualit+ o&erator 8R : on +our own stru"ture t+&e $aria%les e$en though the+ are $alue t+&es2 QB. Aou "an de"lare a default "onstru"tor 8a "onstru"tor with no &arameters: for a stru"ture '. Aes (. 5o Answer: B [ age 161- Bo, 3ou cannot# Q1. If +ou de"lare +our own "onstru"tor in a stru"tureI will the "om&iler still generate the default "onstru"tor. I. 4rue N. Galse Answer: A [ age162- Ahis is not true 5or classes#

MCQ

7a%i%

(I4L

Exam/R12/Module-I/IPL

Module 1 Introducing the programming Chapter 11: Using Arra3s and Collections Q1. *hat is an arra+, Q. Krdered se#uen"e of elements R. Qnordered se#uen"e of elements M. Random se#uen"e of element. 4. 5one of the a%o$e Answer: A [page 1$0# Q2. *hi"h of the following is or are true a%out arra+s, M. 'll the elements in an arra+ ha$e the same t+&e 5. 'll elements in an arra+ has the same name %ut ea"h has different index K. 5um%er of elements in arra+ are fixed "annot %e "hanged on"e "reate P. 'n arra+ itself is a $alue t+&e Answer: A, B, C [page 1$0- An arra3 itsel5 is a re5erence t3pe# Q3. 'rra+s are FFFFFFFI regardless of the t+&e of their elements. Q. $alue t+&e R. referen"e t+&e M. integral t+&e 4. null t+&e Answer: A [page 1$0# Q6. 'rra+ index starts from FFF E. = G. 1 H. 7ow &rogrammers de"ides 7. 5one of the a%o$e Answer: A [page 1$0- Arra3 inde& is 0 )ased in cC# Q>. *hat ha&&ens If +ou s&e"if+ an index that is less than = or greater than or e#ual to the length of the arra+. Q. 5ull is returned R. = $alue is returned M. 4he "om&iler throws an IndexKutKfRangeEx"e&tionI 4. 5othing h&&enns Answer: C [ age 1$2# Q@. If +ou want to iterate through onl+ a ?nown &ortion of an arra+ 8for exam&leI the fi rst half: or to %+&ass "ertain elements 8for exam&leI e$er+ third element:I itSs easier to use a forea"h statement.. O. 4rue L. Galse Answer: B [ age1$?, for statement is useful here2 QB. 4he for statement is the &referred wa+ to iterate through an arra+ C. true ). false Answer: B [ age 1$?- forea"h statement is useful here# Q1. 11. *here the "olle"tion "lasses are li$e in, '. '. In s+stem (. (. In .5E4 Grame wor? C. C. In M+stem. Colle"tion ). ). In M+stem. Colle"tions names&a"e T su%-names&a"e Answer: + [ age 1$6# QJ. 4he %asi" "olle"tion "lasses a""e&tI holdI and return their elements as FFFFFFF. '. o%Le"ts (. integers C. $alue t+&es ). enumerations Answer: A [ age 1$6# Q1=. 4he FFFF "lass im&lements a first-inI first-out 8GIGK: me"hanism. '. 'rra+List (. 7ashta%le C. Mta"? ). Queue Answer: + [ age 1$'# Q1=. 4he FFFF "lass im&lements a last-inI first-out 8LIGK: me"hanism. '. 'rra+List
7a%i% (I4L 1

Exam/R12/Module-I/IPL

(. 7ashta%le C. Mta"? ). Queue Answer: C [ age 1!0# Q11. 4he FFFFF "lass is often "alled asso"iati$e arra+. '. 'rra+List (. 7ashta%le C. Mta"? ). Queue Answer: B [ age 1!1# Q12. ' 7ashta%le "an "ontain du&li"ate ?e+s. '. 4rue (. Galse 'nswer/ ( 0Page 112. ' 7ashta%le "annot "ontain du&li"ate ?e+s2
MCQ

Module 1 Introducing the programming Chapter 11: Understanding arameter Arra3s Q1. FFFFFFFFFFFF is the te"hni"al term for de"laring two or more methods with the same name in the same s"o&e Q. K$erloading P. K$erriding *. Inheritan"e U. Casting Answer: A [page 1'1# Q2. *hat is a $ariadi" method, Q. a method that returns onl+ $alue t+&es R. a method that returns a $aria%le t+&e of information M. a method that ta?es a $aria%le num%er of arguments 4. a method that ta?es a fixed num%er of arguments Answer: C [page 1'1# Q3. Aou "an o$erload a method %ased solel+ on the &arams ?e+word Q. 4rue P. Galse Answer: B [page 1'@ // "om&ile-time error/ du&li"ate de"laration &u%li" stati" int Min8int02 &aramList: ... &u%li" stati" int Min8&arams int02 &aramList: ..# Q6. ' &arams arra+ "an %e the first &arameter I. 4rue N. Galse Answer: B [page 1'@' &arams arra+ must %e the last &arameter. // "om&ile-time error &u%li" stati" int Min8&arams int02 &aramListI int i: ... // o? &u%li" stati" int Min8int iI &arams int02 &aramList: ... 2 Q>. *hat ha&&ens If +ou s&e"if+ an index that is less than = or greater than or e#ual to the length of the arra+. Q. 5ull is returned P. = $alue is returned *. 4he "om&iler throws an IndexKutKfRangeEx"e&tionI U. 5othing ha&&ens Answer: C [ age 1$2# Q@. If +ou want to iterate through onl+ a ?nown &ortion of an arra+ 8for exam&leI the fi rst half: or to %+&ass "ertain elements 8for exam&leI e$er+ third element:I itSs easier to use a forea"h statement.. M. 4rue 5. Galse Answer: B [ age1$?, for statement is useful here2 QB. 4he for statement is the &referred wa+ to iterate through an arra+ E. true
7a%i% (I4L J

Exam/R12/Module-I/IPL

G. false Answer: B [ age 1$?- forea"h statement is useful here# Q1. 11. *here the "olle"tion "lasses are li$e in, E. In s+stem G. In .5E4 Grame wor? H. In M+stem. Colle"tion 7. In M+stem. Colle"tions names&a"e T su%-names&a"e Answer: + [ age 1$6# QJ. 4he %asi" "olle"tion "lasses a""e&tI holdI and return their elements as FFFFFFF. E. o%Le"ts G. integers H. $alue t+&es 7. enumerations Answer: A [ age 1$6# Q1=. 4he FFFF "lass im&lements a first-inI first-out 8GIGK: me"hanism. E. 'rra+List G. 7ashta%le H. Mta"? 7. Queue Answer: + [ age 1$'# Q1=. 4he FFFF "lass im&lements a last-inI first-out 8LIGK: me"hanism. E. 'rra+List G. 7ashta%le H. Mta"? 7. Queue Answer: C [ age 1!0# Q11. 4he FFFFF "lass is often "alled asso"iati$e arra+. E. 'rra+List G. 7ashta%le H. Mta"? 7. Queue Answer: B [ age 1!1# Q12. ' 7ashta%le "an "ontain du&li"ate ?e+s. C. 4rue ). Galse 'nswer/ ( 0Page 112. ' 7ashta%le "annot "ontain du&li"ate ?e+s2
MCQ

Module 1 Introducing the programming Chapter 12: =or.ing with Inheritance Q1. 4he FFFFFFF inherits from the %ase "lass. A. Child "lass V. 5ew "alss ''. )eri$ed "lass ((. M+stem.K%Le"t "lass Answer: C [page 101# Q2. In "EI a "lass is allowed to deri$e from two or more "lasses. Q. 4rue P. Galse Answer: B [page 101 ' "lass is not allowed to deri$e from two or more "lasses# Q3. *hi"h ?e+word is used to &re$ent a "lass from %eing inherited, *. stati" U. $oid A. sealed V. "onst Answer: C [page 101# Q6. *hi"h ?e+word do +ou use to refer a %ase "lassSs mem%er from the deri$ed "lass, O. su&er L. &arent M. this 5. %ase Answer: d [page 10? #
7a%i% (I4L 1=

Exam/R12/Module-I/IPL

Q>. *hat do +ou "all the method if a deri$ed "lass de"lares a method that has the same signature as one in its %ase "lass, A. null method V. new method ''. $irtual methodI ((. o$erloaded method Answer: B [ age 10$# Q>. ' method that is intended to %e o$erridden is "alled a FFFFFFFFFFF. '. null method (. new method C. $irtual methodI ). o$erloaded method Answer: C [ age 10!# QB. *hat do +ou "all the "on"e&t D&ro$iding different im&lementations of the %ase "lassSs method in a deri$ed "lassW, H. K$erloading 7. K$erriding I. 7iding N. "asting Answer: B [ age 10!-# Q1. CE methods are $irtual %+ default. I. 4rue N. Galse Answer: B [ age 10'- CC methods are not 0irtual )3 de5ault- Da0a methods are 0irtual )3 de5ault# QJ. AouSre allowed to define stati" fields in an interfa"e. I. 4rue N. Galse Answer: B [ age 112 AouSre not allowed to define an+ fields in an interfa"eI not e$en stati" ones# Q1=. *hi"h "lass does not allow "reating "reate instan"es of it, I. '%stra"t "lass N. Mealed "lass O. Interfa"e "lass L. 'll of the a%o$e Answer: A [ age 11'# Q11. *hi"h ?e+word is used to &re$ent a "lass from %eing used as a %ase "lass I. a%stra"t N. $irtual O. sealed L. o$erride Answer: C [ age 110#

MCQ

Module 1 Introducing the programming Chapter 1?: Using Ear)age Collection and /esource Management Q1. *hi"h s+m%ol &re"edes %efore the destru"tor in a "lass,. CC. ' hash8E: )). ' &i&e8X: EE. ' tilde 8Y: GG. ' minus 8-: Answer: C [page 120# Q2. Aou "an de"lare a destru"tor in a $alue t+&eI su"h as a stru"t. *. 4rue U. Galse Answer: B [page 121# Q3. Aou ne$er de"lare a destru"tor with &arameters '. 4rue (. Galse Answer: A [page 121# Q6. 4he &ro"ess of destro+ing an o%Le"t and returning memor+ %a"? to the hea& is ?nown as FFFFFFFF K. Memor+ management P. Resour"e "olle"tion Q. Har%age "olle"tion
7a%i% (I4L 11

Exam/R12/Module-I/IPL

R. )estru"tion Answer: C [page 120# Q>. 7ow "an +ou release the resour"e +ourself as #ui"?l+ as &ossi%le, CC. %+ defining destru"tors )). %+ "reating a dis&osal method EE. %+ o$erriding IfinaliZe method GG. 5one of the a%o$e Answer: B [ age 12?# Q@. 4he FFFFFFF statement &ro$ides a "lean me"hanism for "ontrolling the lifetimes of resour"es E. do G. using H. swit"h 7. "he"?ed Answer: B [ age 126#

MCQ

Module 1 Introducing the programming Chapter 1@: Implementing roperties to Access Fields Q1. Calling a method to a"hie$e the effe"t on a field feels a little "lums+. *hat then does alle$iate this aw?wardness, HH. Pro&erties 77. E$ents II. Constru"tors NN. 'll of the a%o$e Answer: A [page 1??# Q2. *hat is a &ro&ert+ of a "lass, A. ' &ro&ert+ is a "ross %etween a field and the "onstru"tor V. ' &ro&ert+ is a "ross %etween a field and a method ''. ' &ro&ert+ is a %ridge %etween a field and its "onsumer ((. 5one of the a%o$e Answer: B [page 1?6# Q3. FFFFFFFFFFFFFFloo?s li?e a field %ut a"ts li?e a method. C. ' Pro&ert+ ). ' method E. ' &u%li" field G. 'n E$ent Answer: A [page 1?6# Q6. 4he FFFFF %lo"? of a &ro&ert+ "ontains statements that exe"ute when the &ro&ert+ is read. M. get 4. set Q. whole P. none of the a%o$e Answer: A [page 1?$# Q>. 4he FFFFFFF %lo"? of a &ro&ert+ "ontains statements that run when the &ro&ert+ is written to '. get (. set C. whole ). none of the a%o$e Answer: B [page 1?$# Q@. *hi"h one is a read-onl+ &ro&ert+, HH. 4he &ro&ert+ that "ontains onl+ get %lo"? 77. 4he &ro&ert+ that "ontains onl+ set %lo"? II. 4he &ro&ert+ that "ontains %oth get and set %lo"? NN. 5one of the a%o$e Answer: A [ age 1?!# QB. *hi"h one is a write-onl+ &ro&ert+, '. 4he &ro&ert+ that "ontains onl+ get %lo"? (. 4he &ro&ert+ that "ontains onl+ set %lo"? C. 4he &ro&ert+ that "ontains %oth get and set %lo"? ). 5one of the a%o$e Answer: B [ age 1?'# Q@. Aou "an use a &ro&ert+ as a ref or an out argument to a method. I. 4rue
7a%i% (I4L 12

Exam/R12/Module-I/IPL

N. Galse Answer: B [ age 1@1# QB. 4he get and set a""essors "an ta?e an+ &arameters. '. 4rue (. Galse Answer: B [page 1@1# Q1. *hi"h s&e"ial $aria%le holds the $alue assigned to the set a""essor of a &ro&ert+, '. data (. $alue C. args ). &aram Answer: B [ age 1@1#
MCQ

Module 1 Introducing the programming Chapter 16: (perator (0erloading Q1. *hi"h one defines whether the o&erator e$aluates from left to right or from right to left, OO. K&erator &re"eden"e LL. K&erator o$erloading MM.K&erator asso"iati$it+ 55. 5one of the a%o$e Answer: C [page 1@!# Q2. *hi"h t+&e of o&erator o&erates on Lust one o&erand, CC. Qnar+ o&erator )). (inar+ o&erator EE. 4rinar+ K&erator GG. 5one of the a%o$e Answer: A [page 1@!# Q3. *hi"h t+&e of o&erator o&erates on two o&erands, '. Qnar+ o&erator (. (inar+ o&erator C. 4rinar+ K&erator ). 5one of the a%o$e Answer: B [page 1@!# Q6. *hi"h of the following is a unar+ o&erator, H. 7. I. , N. -Answer: + [page 1@!# Q>. Aou "an "hange the &re"eden"e and asso"iati$it+ of an o&erator. *. 4rue U. Galse Answer: A [page 1@!, Bo- 3ou cannot# Q@. In "EI +ou "an in$ent new o&erator s+m%ols '. 4rue (. Galse Answer: B [page 1?$, 3ou can onl3 o0erload e&isting operators# QB. *hi"h o&erator +ou cannot o$erload, OO. Plus 8-: LL. In"rement 8--: MM.E#ualit+ 8 : 55. )ot 8.: Answer: A [ age 1@'# Q1. *hi"h of the following should %e true while o$erloading o&erators, E. 'll o&erators must %e &u%li" G. 'll o&erators must %e stati" H. $irtualI a%stra"tI o$errideI or sealed modifiers "annot %e used 7. o$erloaded "annot ta?e an+ &arameter Answer: A, B, C [ age 1@'- Binar3 operators must accept two arguments and unar3 operator must accept one operator# QJ. *hi"h of the o&erators must %e o$erloaded as &airs,. O. and R
7a%i% (I4L 13

Exam/R12/Module-I/IPL

L. C and . M. C and . 5. - and Answer: A, B, C [ age 166# Q1=. *hi"h one is im&li"it "asting, '. dou%le d9 int a 2=9 d a9 (. int a9 dou%le d 2.339 a 8int:d C. int a Con$ert.4o)ou%le8 D2=.33W:9 ). 5one of the a%o$e 'nswer/ ' 0Page 2B=2 Q11. *hi"h one is ex&li"it "asting, '. dou%le d9 int a 2=9 d a9 (. int a9 dou%le d 2.339 a 8int:d C. int a Con$ert.4o)ou%le8 D2=.33W:9 ). 5one of the a%o$e 'nswer/ ( 0Page 2B=2

MCQ

Module 1 Introducing the programming Chapter 1$: Introducing the =indows +orms Q1. *hi"h &ro&ert+ of a windows form should +ou "hange to set the text shown on the title %ar, KK. 4itle PP. 4ext QQ. 4itle4ext RR. Aou "annot "hange that Answer: B [page 1$!# Q2. *hi"h is the statement for running an a&&li"ation form, '. '&&li"ation.Run8 Gorm instan"e:9 (. M+stem.Run8Gorm instan"e:9 C. Gorm.Run8Gorm instan"e:9 ). 5one of the a%o$e. Answer: A [page 1!0# Q3. *hi"h &ro&ert+ of a form "an %e used to "ontrol the le$el of trans&aren"+, E. K&a"it+ G. (a"?Color H. 4rans&aren"+ 7. 5one of the a%o$e Answer: A [page 1$!# Q6. *hi"h &ro&ert+ of a form returns the "ontrol that is "urrentl+ in fo"us, O. CurrentControl L. Go"usedControl M. '"ti$eControl 5. 4a%Index Answer: C [page 1$!# Q>. *hat is the &ur&ose of the im&lemented )is&ose method in windows form "ontrol,. A. 4o "lose the form V. 4o hide the form ''. 4o release unmanaged resour"es as #ui"?l+ as &ossi%le ((. 5one of the a%o$e Answer: C [page 1!1# Q@. *hi"h $isual studio generated method instantiate all "ontrols +ou added to a form and set their &ro&ertiesI wires e$ent handler with "ontrols, C. InitialiZe ). InitialiZeContols E. InitialiZeCom&onent G. 4here is no su"h method Answer: C [page 1!1# QB. *hi"h e$ent is raised Lust %efore a windows form is a"tuall+ "losed, KK. Closing PP. GormClosing QQ. )is&osing RR. Gorm)is&osing
7a%i% (I4L 16

Exam/R12/Module-I/IPL

Answer: B[ age 1'1# Q1. *hat is the return t+&e of the stati" method Mhow the Message(ox, I. int N. (uttonMtate O. )ialogResult L. string Answer: C [ age 1'2# QJ. *hi"h of the o&erators must %e o$erloaded as &airs,. K. and R P. C and . Q. C and . R. - and Answer: A, B, C [ age 166# Q1=. *hi"h one is im&li"it "asting, E. dou%le d9 int a 2=9 d a9 G. int a9 dou%le d 2.339 a 8int:d H. int a Con$ert.4o)ou%le8 D2=.33W:9 7. 5one of the a%o$e 'nswer/ ' 0Page 2B=2 Q11. *hi"h one is ex&li"it "asting, E. dou%le d9 int a 2=9 d a9 G. int a9 dou%le d 2.339 a 8int:d H. int a Con$ert.4o)ou%le8 D2=.33W:9 7. 5one of the a%o$e 'nswer/ ( 0Page 2B=2

MCQ

Module 1 Introducing the programming Chapter 1!: =or.ing with Menus and +ialog Bo&es Q1. *hi"h one is used "reate Menu, MM. MainMenu 44. Menu QQ. MenuMtri& PP. 4oolMtri& Answer: C [page 1'?# Q2. *hi"h s+m%ol +ou use to "reate a se&arator %ar on a menu while designing a menu $isuall+ in $isual studio, E. T G. [ H. 7. E Answer: C [page 1'6# Q3. *hi"h s+m%ol +ou use to "reate a hot ?e+ on, '. T (. [ C. \ a menu ). E Answer: A [page 1'6# Q6. *hi"h &ro&ert+ of a menu item is used to show a text as ti& when the user ho$ers the mouse o$er the menu item, K. ContextMenu P. 4o& Q. 4ool4i& R. 4ool4ext Answer: C [page 200# Q>. *hat do +ou "all the menu whi"h is shown when users right-"lo"? on a "ontrol,. CC. )ro&downMenu )). Menu EE. Po&-u& menu GG. Pro&erties Answer: C [page 201# Q@. Multi&le "ontrol are not allowed to share the same "ontext-menu, H. 4rue
7a%i% (I4L 1>

Exam/R12/Module-I/IPL

7. Galse Answer: B [page 202# QB. *hat is a D"ommon-dialogW, MM. Mome "ommon "ontrols that are share %etween two or more a&&li"ations 44. Mome "ommon and standard dialog %oxes su&&lied with windows KM that "an %e used with +our own a&&li"ations QQ. Mome "ommon HQI design guide lines PP. 5one of the a%o$e Answer: B [ age 20!, (pen+ialog, Sa0e+ialog etc# Q1. *hat is the return t+&e of the stati" method Mhow the Message(ox, M. int 5. (uttonMtate K. )ialogResult P. string Answer: C [ age 1'2#

MCQ

Module 1 Introducing the programming Chapter 1': er5orming 4alidation Q1. *hi"h is the &ur&ose data $alidation, **. 4o ensure data is "orre"tl+ &ro"essed UU. 4o enusure that data entered %+ a user mat"hes %usiness rules AA. 4o ensure out&ut &rodu"ed %+ the a&&li"ation is in "orre"t format VV. 'll of the a%o$e Answer: B [page 21?# Q2. *hi"h &ro&ert+ indi"ates whether a "ontrol raises $alidation e$ent or not, I. Palidation N. Palidate O. CausesPalidation L. Che"? Answer: C [page 21?# Q3. *hi"h two e$ents do +ou use to $alidate data in a "ontrol, E. Palidate G. Palidated H. Palidating 7. KnPalidate Answer: B, C [page 21?# Q6. *hat is the default $alue of CausePalidation, '. = (. null C. true ). false Answer: C [page 21?# Q>. 4he Palidated o""urs FFFFFFFF Palidating. '. (efore (. 'fter C. 5one ). 'll Answer: B [page 21?# Q@. Multi&le "ontrol are not allowed to share the same "ontext-menu, I. 4rue N. Galse Answer: B [page 202# QB. *hat is a D"ommon-dialogW, **. Mome "ommon "ontrols that are share %etween two or more a&&li"ations UU. Mome "ommon and standard dialog %oxes su&&lied with windows KM that "an %e used with +our own a&&li"ations AA. Mome "ommon HQI design guide lines VV. 5one of the a%o$e Answer: B [ age 20!, (pen+ialog, Sa0e+ialog etc# Q1. *hat is the return t+&e of the stati" method Mhow the Message(ox, Q. int R. (uttonMtate
7a%i% (I4L 1@

Exam/R12/Module-I/IPL

M. )ialogResult 4. string Answer: C [ age 1'2#

7a%i%

(I4L

1B

You might also like