Part I. Multiple Choice Questions (3 points each):
Generics and parameterized types eliminate the need for downcasts when using Java Collections. III. When designing your own collections class (say a linked
Operating System Multiple Choice Questions ? - m.central.edu
answers chapter 2 to practice test questions: Standard C library functions
Part I. Multiple Choice Questions (3 points each):
(a) If a parameterized type is not specified the code will not compile. (b) No parameterized type is needed because Java will use the Object class as a
Java Mock Test - TutorialsPoint
C - An immutable object is an instance of an abstract class. Page 5. D - None of the above. Q 21 - What is local variable?
AP Computer Science A 7th Edition
Multiple-Choice Questions on Inheritance and Polymorphism . in this review book is part of the AP Java subset unless explicitly stated otherwise.
AP Computer Science Principles Course and Exam Description
multiple-choice questions and this raw score is Programmers integrate algorithms and abstraction to create programs ... write programs in Java.
Enterprise Java - TYBSCIT Regular - 5 SAMPLE MCQ Questions
the network within a Java application is known as ______ d. leaky abstractions ... TYIT Semester V - AWP Sample Multiple Choice Questions.
Object oriented programming in java mcq with answers pdf
Object oriented programming in java mcq with answers pdf The Java language provides an effective level of abstraction to non-Java pointers developers.
AP Computer Science Principles Course and Exam Description
multiple-choice questions and this raw score is Programmers integrate algorithms and abstraction to create programs ... write programs in Java.
Java-Interview-Questions.pdf
Java Interview Questions. 2 / 30. 1.4 Abstraction. Abstraction is the process of separating ideas from specific instances and thus develop classes in terms
3.Whenwouldyouuseaprivateconstructor?
(a)Whenyougetboredwithpublic (d)Never,it'snotallowed (a)char (b)boolean (c)byte (d)int 1 publicclassSwitch{ publicstaticvoidmain(String[]args){ inti=1; switch(i){ case0: intj=0;System.out.print(j);
case1: intj=1;System.out.print(j);
case2: intj=2;System.out.print(j);
default: intj=-1;System.out.print(j);
(a)12-1 (b)1 (c)12 (d)ThecodedoesnotcompileInteger[]someInts=newInteger[100];
intsum=0; for(Integeri:someInts) sum+=i;System.out.println(sum/someInts.length);
(a)0 (b)thesumof100integers (c)NullPointerException (d)thecodewillnotcompile 2 charx='A'; while(x!='D'){ switch(x){ case'A':System.out.println(x);
x='D'; case'B':System.out.println(x);
x='C'; break; case'C':System.out.println(x);
x='D'; default: continue; (a)A D C (b)A D C D (c)A D (d)A (a)aclassobjectandaclasstype (b)anyprimitivetype (c)booleantypeonly (d)classtypesonly (a)voidhandle(ActionEvente) (b)voidactionPerformed(ActionEvente) (c)voideventDispatched(AWTEvente) (d)StringgetActionCommand(ActionEvente) 3 publicclassAextendsException{...} publicclassBextendsA{...} publicclassCextendsB{...} publicvoiddoStuff()throwsA,B,CThefollowingcodedoesnotcompile.Why?
try{ doStuff(); }catch(Aa){ a.printStackTrace(); }catch(Bb){ b.printStackTrace(); }catch(Cc){ c.printStackTrace(); }finally{System.out.println("Iloveexceptions!");
becaught.12.Whatistheoutputofthefollowingprogram?
publicclassA{ publicstaticintdoStuff(doublex,doubley){ return(int)(x/y); publicstaticvoidmain(){ floatx=6.0; inty=11; x=A.doStuff(y,x);System.out.print("x="+x+",y="+y);
(a)x=1,y=11 (b)thisprogramdoesnotcompile (c)x=6.0,y=11 (d)x=1.0,y=11 4 privateDatetoday; +today.toString()+"is"+favColor); //...SomewheresomeMethodiscalled...Stringname="Topato";
StringfavColor="Green";
someMethod(favColor,name); (a)thiscodewillnotcompile (d)NullPointerException intx,y,z; y=1; z=5; x=0-(++y)+z++; (a)x=4,y=2,z=6 (b)x=4,y=1,z=5 (c)x=3,y=2,z=6 (d)x=-7,y=1,z=515.Anarrayobject,ArrayOne,iscreatedas:
float[][]ArrayOne;ArrayOne=newfloat[20][10];
themethod? (a)float[][]someArray (b)floatsomeArray[] (c)float[]someArray[20] (d)floatsomeArray[20][10] 5 classReindeerthrowsHoHoHoException{...} Why?FileoutFile=newFile("Santa.txt");
Reindeerr;
for(inti=0;i<9;i++){ r=newReindeer("Reindeer"+(i+1)); outObjectStream.writeObject(r); (b)Only8Reindeerobjectsarewritten tothefile?II.Whenthedatabufferisfull
III.Whentheclosefunctioniscalled
(a)Ionly (b)IIIonly (c)IIandIII (d)IIonly18.Whywouldaclassbedeclaredasabstract?
(b)Sothatitcanbeusedasaninterface (c)Sothatitcannotbeinheritedfrom (d)Becauseithasnoabstractmethods (b)Noneoftheseistrue (c)ItalwaysforcesCtobecomeabstract 6 publicclassBGiventhefollowingvariabledeclaration:
Personp=newPerson();
Students=newStudent();
Undergraduateug=newUndergraduate();
Whichofthefollowingassignmentsarelegal?
I.p=ug;
II.p=newUndergraduate();
III.ug=newStudent();
IV.ug=p;
V.s=newPerson();
(a)IIIandIV (b)IandIV (c)IandII (d)II,IIIandV pile? abstractclassBirdimplementsLivestock{} classChickenextendsBird{} (a)Birdbird=newChicken(); (b)Livestocklivestock=newChicken(); (c)Birdbird=newBird(); (d)Noneofthesewillcompile 7 responsibilitiestothecompiler. whenusingJavaCollections. classes. (a)IandII (b)IIandIII (c)I,II,andIII (d)IandIII classA privatevoidsomeMeth()System.out.println("fromclassA");
classBextendsA publicvoidsomeMeth(Stringx)System.out.println("fromclassB:"+x);
(a)methodoverriding (b)methodoverloading 8 classBoxI.Box
II.Boxb=newSuperBox();
IIIBox
(a)I,II,III (b)IIonly (c)IandIIIonly (d)Ionly privateintf(intx,inty){ if(x==0){ returny; }else{ returnf(x-1,y+1); (a)0 (b)17 (c)Thisrecursionisincorrectinsomeway. (d)72 privateintg(intnum){ if(num<=1){ return1; }else{ return3*g(num-1)+g(num-2); (a)Thisrecursionisincorrectinsomeway. (b)43 (c)4 (d)13 9 intf(intnum){ if(num<=2) returnnum; else returnnum*g(num-1); intg(intnum){ if(num<=2) returnnum; else return(num-1)*f(num+1); (a)1,2,6,24,... (b)Thisrecursionisincorrectinsomeway. (c)1,2,3,6,... (d)1,2,6,16,... 15 2321
19 publicstaticvoidprintNums() intn;
Stringline;
line=inFile.readLine(); if(line!=null){//IfnotEOF.. n=Integer.valueOf(line).intValue(); outFile.print(n+""); printNums(); outFile.print(n+""); (a)1523211919212315 (b)1921231519212315 (c)15232119 (d)19212315 10 (A)inthefrontoftheclassroom.Thankyou. 11Thispageisleftblankintentionally.
12 example,iftheinputis... 3886
92
55
83
42
90
-1 thentheoutputshouldbe:
Totalnumberofgrades=7
NumberofA=2
NumberofB=2
NumberofC=0
NumberofD=0
NumberofF=3
TheAgradesare:92,90
13Solutionforprogrammingquestion1:
14 histoybag.GenderFirstNameLastNameStatus
MJackFrostBad
FCindyLouWhoGood
MRudolphRednose-ReindeerGood
Frost,JackCoal
Who,CindyLouPony
Rednose-Reindeer,RudolphBicycle
LumpsofCoal:1
Bicycles:1
Ponies:1
thatmightbethrown. 15Solutionforprogrammingquestion2:
16Animalshouldnotbeabletobeinstantiated.
classes. 17Solutionforprogrammingquestion3:
18 19Solutionforprogrammingquestion4part1:
publicclassNodeANodeobjectwhichpointstothetopofthestack
object) thestack. object. empty,returnanullobject. 21Solutionforprogrammingquestion4part2:
22NoSirpreferprison
Racecar
StrawWarts
neveroddorevenOozyratinasanitaryzoo
isasampleoutput.Thestring:'Trythis'isNOTapalindrome
23Solutionforprogrammingquestion5:
24quotesdbs_dbs17.pdfusesText_23
[PDF] mécanique statique exercice corrigé pdf
[PDF] median and mode worksheets with answer key
[PDF] median definition
[PDF] median mode formula
[PDF] median mode grouped data pdf
[PDF] median mode questions and answers pdf in hindi
[PDF] meilleur langage de programmation pour créer un site web
[PDF] mercedes sprinter utilitaire occasion france
[PDF] météo (74100 annemasse france)
[PDF] meteo france apremont 01100
[PDF] meteo france arques 62510
[PDF] météo france beauvais 60000
[PDF] meteo france etaples 62630
[PDF] meteo france hesdin 62140