SlideShare a Scribd company logo
1 of 19
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section4
(Answerall questionsinthissection)
1. In Eclipse,whenyouruna Java Application,where maythe resultsdisplay? Mark forReview
(1) Points
Editor Window
Console View (*)
DebugView
Task List
None of the above
Correct
2. What are the Eclipse EditorAreaand Viewsusedfor? Mark for Review (1) Points
(Choose all correctanswers)
To modifyelements.(*)
To navigate ahierarchyof information.(*)
To choose the file systemlocationtodelete afile.
Correct
3. A combinationof viewsandeditorsare referredtoas_______________. Mark forReview
(1) Points
A workspace
A physical location
A perspective (*)
All of the above
Correct
4. In the image below,identifythe components.
Mark for Review(1) Points
A-MainMethod,B-Class,C-Package
A-Class,B-MainMethod,C-Package
A-Package,B-MainMethod,C-Class(*)
None of the above
Correct
5. A counterusedina For loopcannotbe initializedwithinthe Forloopheader.True orfalse?
Mark forReview(1) Points
True
False (*)
Correct
Page 1 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestion scoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section4
(Answerall questionsinthissection)
6. In the code fragmentbelow,the syntax forthe forloop'sinitializationiscorrect.True or false?
publicclassForLoop{
publicstaticvoidmain(Stringargs[])
{
for ((int1=10) (i<20) (i++))<
{System.out.Println("i:"+i);}
}
}
Mark for Review(1) Points
True
False (*)
Correct
7. When importinganotherpackage intoaclassyou mustimportonlythe package classesthatwill
be calledandnot the entire package.True or false? Mark for Review (1) Points
True
False (*)
Correct
8. Which of the twodiagramsbelowillustrate the correctsyntax forvariablesusedinanif-else
statement? Mark forReview(1) Points
Example A (*)
Example B
Correct
9. What are Java's simple types? Mark for Review (1) Points
boolean,byte,char,double,float,int,long,andshort(*)
boolean,byte,string,thread,int,double,longandshort
object,byte,string,char,float,int,longandshort
boolean,thread,stringbuffer,char,int,float,longandshort
boolean, thread,char,double,float,int,longandshort
Correct
10. Selectthe declarationandinitializationstatementthatwill holdthe letterJ. Mark for Review
(1) Points
int letter='J';
floatletter='J';
Stringletter='J';
char letter='J';(*)
Correct
Previous Page 2 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section4
(Answerall questionsinthissection)
11. Whichof the followingare relationaloperatorsinJava? Mark for Review (1) Points
(Choose all correctanswers)
< (*)
<= (*)
=
!= (*)
All of the above.
Correct
12. What isthe outputof the followinglinesof code?
intj=6,k=4,m=12,result;
result=j/m*k;
System.out.println(result); Mark for Review (1) Points
2
0 (*)
48
24
Correct
13. Whichof the followingisthe name of a Java primitive datatype? Mark forReview
(1) Points
Object
Rectangle
double (*)
String
Correct
14. The three logicoperatorsinJava are: Mark forReview (1) Points
&&, ||, ! (*)
!=,=,==
&&,!=,=
&,|,=
Correct
15. The six relational operatorsinJavaare: Mark for Review (1) Points
>,<,=,!,<=,>=
>,<,==,!=,<=,>= (*)
>,<,=,!=,<=,>=
>,<,=,!=,=<,=>
Correct
Previous Page 3 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section5
16. All of the followingare essential toinitializingaFORloop,exceptwhichone? Mark for Review
(1) Points
Initializingthe iterator(i).
Havinga conditional statement.
Updatingthe counter.
Havingan if statement.(*)
Correct
17. Updatingthe inputof a loopallowsyoutoimplementthe code withthe nextelementrather
than repeatingthe code alwayswiththe same element.True orfalse? Mark for Review (1) Points
True (*)
False
Correct
18. What isthe outputof the followingcode segment?
intnum = 7;
while(num>=0)
{
num-= 3;
}
System.out.println(num); Mark for Review (1) Points
-2 (*)
1
0
2
Correct
19. Why are loopsuseful? Mark forReview (1) Points
Theysave programmersfromhavingto rewrite code.
Theyallowforrepeatingcode a variable numberof times.
Theyallowforrepeatingcode until acertainargumentismet.
All of the above.(*)
Incorrect.RefertoSection5 Lesson1.
20. Whichof the followingcallsthe methodcalculate correctly?
Mark for Review(1) Points
ThisClasst=newThisClass();intx=t.calculate(3,4);(*)
int x=calculate(3,4);
ThisClasst=newThisClass();intx=t.calculate(3);
ThisClasst=newThisClass();intx=t.calculate();
Incorrect.RefertoSection5 Lesson2.
Previous Page 4 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section5
21. A classcan onlyhave one constructor.True or false? Mark for Review (1) Points
True
False (*)
Correct
22. What value will returnforj whenthe setValue methodiscalled?
Mark for Review(1) Points
31
32
10
11 (*)
Correct
23. The followingstatementcompilesandexecutes.Whatdoyouknow for certain?
tree.grows(numFeet); Mark for Review(1) Points
numFeetmustbe an int.
tree must be the name of the class.
grows mustbe the name of an instance field.
grows mustbe the name of a method.(*)
tree must be a method.
Correct
24. The followingcode createsanObjectof type Animal.True orfalse?
Animal a=newAnimal(); Mark for Review (1) Points
True (*)
False
Correct
25. The followingcode createsanObjectof type Horse.True or false?
Whale a=newWhale(); Mark for Review (1) Points
True
False (*)
Correct
Previous Page 5 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,and questionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section5
26. The followingcode isagoodexample of usingthe thisreference.True orfalse?
Mark for Review(1) Points
True
False (*)
Correct
Section6
27. The followingarraydeclarationisvalid.True orfalse?
int[] y= newint[5]; Mark forReview(1) Points
True (*)
False
Correct
28. What isthe outputof the followingsegmentof code? Mark forReview (1) Points
456789
777777 (*)
555555
987654
Thiscode doesn'tcompile.
Correct
29. Whichof the followingstatementsisnota validarraydeclaration? Mark for Review
(1) Points
int number[];
float[]averages;
double marks[5];
counterint[];(*)
Incorrect.RefertoSection6 Lesson1.
30. What isthe outputof the followingsegmentof code?
intarray[][] = {{1,2,3},{3,2,1}};
for(inti=0;i<2;i++)
for(intj=0;j<3;j++)
System.out.print(2*array[1][1]); Mark forReview (1) Points
444444 (*)
123321
246642
222222
This code doesn'tcompile.
Correct
Previous Page 6 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section6
31. Considerthe followingcode snippet
Stringforest= newString("Black");
System.out.println(forest.length());
What isprinted? Mark for Review(1) Points
5 (*)
6
7
Black
Forest
Correct
32. Whichof the followingcreatesaStringnamedChar? Mark for Review (1) Points
char string;
StringChar; (*)
char Char;
char char;
Stringchar;
Correct
33. The followingcode isanexample of acorrectinitializationstatement:
char c="c"; Mark for Review(1) Points
True
False (*)
Correct
34. The == operatorcan be usedto compare twoStringobjects.The resultisalwaystrue if the two
stringsare have the exactsame characters ineach positionof the String.True or false? Mark for
Review(1) Points
True
False (*)
Correct
35. Whichof the followingcouldbe areasonto throw an exception? Mark for Review
(1) Points
To eliminate exceptionsfromdisruptingyourprogram.(*)
You have a fatal errorin yourprogram.
You have encounteredaStackOverflow Error.
To make the userinterface hardertonavigate.
Correct
Previous Page 7 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section6
36. Whichof the followingcorrectlymatchesthe symbol withitsfunction? Mark for Review
(1) Points
(Choose all correctanswers)
== (twoequal signs) comparesvaluesof primitivetypessuchasintor char. (*)
== (twoequal signs) comparesthe valuesof non-primitiveobjects.
== (twoequal signs) comparesthe memorylocationof non-primitiveobjects.(*)
= (single equalssign) comparesthe value of primitive typessuchasint or char.
.equals()comparesthe value of non-primitive objects.(*)
Correct
37. If an exceptionisthrownbya method,where canthe catch for the exceptionbe? Mark for
Review
(1) Points
There doesnot needtobe a catch inthissituation.
The catch must be inthe methodthat threw the exception.
The catch can be inthe methodthat threw the exceptionorinanyothermethodthatcalledthe
methodthatthrewthe exception.(*)
The catch must be immediatelyafterthe throw.
Incorrect.RefertoSection6 Lesson3.
38. Suppose youare writinga programwhere the userispromptedtothe give coordinateswhere
theybelievethe princessisinside of the castle.
Your program movesthe prince tothe coordinatesthatthe user specified.If the princessisnot
foundat those coordinates,the userisgivenaclue thathelpsthemguesscoordinatesclosertothe
princess.The userisallowedto entertheirnew guessof where the princessis.
Assume yourprogramdoesnot take intoconsiderationthe possibilitythatthe usermayenter
coordinatesoutside of the castle where the princesscouldnotbe.Whatwouldbe the resultof the
userenteringcoordinatesoutside of the castle?How couldthisbe handledinyourcode? Mark for
Review
(1) Points
(Choose all correctanswers)
Anerror wouldoccur.Errors cannot be handledbycode.
Anexceptionwouldoccurbutcouldnot be handledinside yourcode.The userwouldhave to
restartthe programand enterpropercoordinates.
Anexceptionwouldoccur.Thiscouldbe handledbythrowingthe exceptioninyourcode if the
userentersinvalidcoordinates.Whenthe exceptioniscaught,the prince couldbe movedtothe
coordinate inside the castle thatisclosesttothose thatthe userspecified.(*)
Anexceptionwouldoccur.Thiscouldbe handledbythrowinganexceptioninyourcode if the
userentersinvalidcoordinates.Whenthe exceptioniscaught,the usercouldbe promptedtoenter
coordinateswithinthe givenrange of the castle.(*)
Incorrect.RefertoSection6 Lesson3.
Section7
(Answerall questionsinthissection)
39. Anaccess modifierisakeywordthatallowssubclassestoaccessmethods,data,and
constructorsfrom theirparentclass.True or false? Mark forReview (1) Points
True (*)
False
Incorrect.Referto Section7 Lesson3.
40. Whichof the followingisthe correctway tocall an overridenmethodneedOil() of asuperclass
Robotin a subclassSqueakyRobot? Mark for Review (1) Points
Robot.needOil(SqueakyRobot);
SqueakyRobot.needOil();
super.needOil();(*)
needOil(Robot);
Incorrect.RefertoSection7 Lesson3.
Previous Page 8 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section7 (Answerall questionsinthissection)
41. What isthe JavaApplet? Mark for Review (1) Points
(Choose all correctanswers)
It isthe virtual machine thattranslatesJavacode intoa representationthatthe computercan
understand.
A web-basedJavaprogramthatis embeddedintoawebbrowser.(*)
A graphic visual includedinJava.(*)
There isno suchthingas a JavaApplet.
Incorrect.RefertoSection7 Lesson3.
42. Whichsegmentof code representsacorrectway to define avariable argumentmethod?
Mark forReview(1) Points
StringeasyArray(String...elems){//code} (*)
StringeasyArray(...Stringelems){//code}
String...easyArray(Stringelems){//code}
IntegereasyArray...(intelems) {//code}
Correct
43. Whichof the followingisthe correctway tocode a methodwitha returntype an object
Automobile? Markfor Review(1) Points
Automobileupgrade(StringcarA){
carA="Turbo";
returncarA;}
Automobile upgrade(Automobile carA){
carA.setTurbo("yes");
returncarA;} (*)
Stringupgrade(StringcarA){
carA="Turbo";
returncarA;}
upgrade(Automobile carA) Automobile{
carA.setTurbo("yes");
returncarA;}
None of the above.Itisnot possible toreturnanobject.
Correct
44. Choose the correctimplementationof apublicaccessmodifierforthe methoddivide. Mark
for Review(1) Points
divide(inta,intb,public) {returna/b;}
publicdivide(inta,intb) {returna/b;}(*)
divide(inta,intb) {publicreturna/b;}
divide(publicinta,publicintb) {returna/b;}
Correct
45. Staticmethodscan readinstance variables.True orfalse? Mark for Review (1) Points
True
False (*)
Correct
Previous Page 9 of 10 Next Summary
Test:Java FundamentalsFinal Exam
Reviewyouranswers,feedback,andquestion scoresbelow.Anasterisk(*) indicatesacorrect
answer.
Section7 (Answerall questionsinthissection)
46. Staticmethodscan write toclass variables.True orfalse? Mark for Review (1) Points
True (*)
False
Incorrect.RefertoSection7 Lesson2.
47. A staticvariable isalwayspubliclyavailable.True orfalse? Mark for Review (1) Points
True
False (*)
Correct
48. Abstractclassescannotimplementinterfaces.True orfalse? Mark for Review (1) Points
True
False (*)
Incorrect.RefertoSection7 Lesson4.
49. If Oak extendsTree,itispossibletodeclare anobjectsuchthat
Tree grandfatherT= newOak();
True or false? Mark for Review(1) Points
True (*)
False
Correct
50. Abstractclass cannotextendanotherabstractclass.True or false? Mark for Review
(1) Points
True
False (*)
Correct
Previous Page 10 of 10 Summary

More Related Content

What's hot

45 aop-programming
45 aop-programming45 aop-programming
45 aop-programming
daotuan85
 

What's hot (15)

C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
12. Exception Handling
12. Exception Handling 12. Exception Handling
12. Exception Handling
 
45 aop-programming
45 aop-programming45 aop-programming
45 aop-programming
 
Multiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceMultiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritance
 
Multiple Choice Questions for Java interfaces and exception handling
Multiple Choice Questions for Java interfaces and exception handlingMultiple Choice Questions for Java interfaces and exception handling
Multiple Choice Questions for Java interfaces and exception handling
 
White box testing
White box testingWhite box testing
White box testing
 
Impact of Tool Support in Patch Construction
Impact of Tool Support in Patch ConstructionImpact of Tool Support in Patch Construction
Impact of Tool Support in Patch Construction
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 
PVS-Studio team is about to produce a technical breakthrough, but for now let...
PVS-Studio team is about to produce a technical breakthrough, but for now let...PVS-Studio team is about to produce a technical breakthrough, but for now let...
PVS-Studio team is about to produce a technical breakthrough, but for now let...
 
Templates exception handling
Templates exception handlingTemplates exception handling
Templates exception handling
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
 
Repair dagstuhl jan2017
Repair dagstuhl jan2017Repair dagstuhl jan2017
Repair dagstuhl jan2017
 
Sample quizz test
Sample quizz testSample quizz test
Sample quizz test
 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
 
Java chapter 3
Java chapter 3Java chapter 3
Java chapter 3
 

Similar to Test final jav_aaa

All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfAll based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
aroraenterprisesmbd
 
Scjp questions
Scjp questionsScjp questions
Scjp questions
roudhran
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
maxinesmith73660
 
1 Midterm Preview Time allotted 50 minutes CS 11.docx
1  Midterm Preview Time allotted 50 minutes CS 11.docx1  Midterm Preview Time allotted 50 minutes CS 11.docx
1 Midterm Preview Time allotted 50 minutes CS 11.docx
honey725342
 
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdfAll based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
deepakarora871
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
Vivek Singh
 

Similar to Test final jav_aaa (20)

All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfAll based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.com
 
Optimization in the world of 64-bit errors
Optimization  in the world of 64-bit errorsOptimization  in the world of 64-bit errors
Optimization in the world of 64-bit errors
 
Scjp questions
Scjp questionsScjp questions
Scjp questions
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.com
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
GSP 215 Education Organization - snaptutorial.com
GSP 215  Education Organization - snaptutorial.comGSP 215  Education Organization - snaptutorial.com
GSP 215 Education Organization - snaptutorial.com
 
GSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.com
 
Gsp 215 Massive Success / snaptutorial.com
Gsp 215  Massive Success / snaptutorial.comGsp 215  Massive Success / snaptutorial.com
Gsp 215 Massive Success / snaptutorial.com
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.com
 
1 Midterm Preview Time allotted 50 minutes CS 11.docx
1  Midterm Preview Time allotted 50 minutes CS 11.docx1  Midterm Preview Time allotted 50 minutes CS 11.docx
1 Midterm Preview Time allotted 50 minutes CS 11.docx
 
Java Quiz
Java QuizJava Quiz
Java Quiz
 
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage" Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
 
Java language fundamentals
Java language fundamentalsJava language fundamentals
Java language fundamentals
 
CIS 115 Education Specialist / snaptutorial.com
CIS 115  Education Specialist / snaptutorial.comCIS 115  Education Specialist / snaptutorial.com
CIS 115 Education Specialist / snaptutorial.com
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
 
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdfAll based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
 
Quiz5
Quiz5Quiz5
Quiz5
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 

Test final jav_aaa

  • 1. Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section4 (Answerall questionsinthissection) 1. In Eclipse,whenyouruna Java Application,where maythe resultsdisplay? Mark forReview (1) Points Editor Window Console View (*) DebugView Task List None of the above Correct 2. What are the Eclipse EditorAreaand Viewsusedfor? Mark for Review (1) Points (Choose all correctanswers) To modifyelements.(*) To navigate ahierarchyof information.(*) To choose the file systemlocationtodelete afile. Correct 3. A combinationof viewsandeditorsare referredtoas_______________. Mark forReview (1) Points A workspace A physical location A perspective (*) All of the above Correct
  • 2. 4. In the image below,identifythe components. Mark for Review(1) Points A-MainMethod,B-Class,C-Package A-Class,B-MainMethod,C-Package A-Package,B-MainMethod,C-Class(*) None of the above Correct 5. A counterusedina For loopcannotbe initializedwithinthe Forloopheader.True orfalse? Mark forReview(1) Points True False (*) Correct Page 1 of 10 Next Summary
  • 3. Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestion scoresbelow.Anasterisk(*) indicatesacorrect answer. Section4 (Answerall questionsinthissection) 6. In the code fragmentbelow,the syntax forthe forloop'sinitializationiscorrect.True or false? publicclassForLoop{ publicstaticvoidmain(Stringargs[]) { for ((int1=10) (i<20) (i++))< {System.out.Println("i:"+i);} } } Mark for Review(1) Points True False (*) Correct 7. When importinganotherpackage intoaclassyou mustimportonlythe package classesthatwill be calledandnot the entire package.True or false? Mark for Review (1) Points True False (*) Correct 8. Which of the twodiagramsbelowillustrate the correctsyntax forvariablesusedinanif-else statement? Mark forReview(1) Points
  • 4. Example A (*) Example B Correct 9. What are Java's simple types? Mark for Review (1) Points boolean,byte,char,double,float,int,long,andshort(*) boolean,byte,string,thread,int,double,longandshort object,byte,string,char,float,int,longandshort boolean,thread,stringbuffer,char,int,float,longandshort boolean, thread,char,double,float,int,longandshort Correct 10. Selectthe declarationandinitializationstatementthatwill holdthe letterJ. Mark for Review (1) Points int letter='J';
  • 5. floatletter='J'; Stringletter='J'; char letter='J';(*) Correct Previous Page 2 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section4 (Answerall questionsinthissection) 11. Whichof the followingare relationaloperatorsinJava? Mark for Review (1) Points (Choose all correctanswers) < (*) <= (*) = != (*) All of the above. Correct 12. What isthe outputof the followinglinesof code? intj=6,k=4,m=12,result; result=j/m*k; System.out.println(result); Mark for Review (1) Points 2 0 (*) 48 24 Correct
  • 6. 13. Whichof the followingisthe name of a Java primitive datatype? Mark forReview (1) Points Object Rectangle double (*) String Correct 14. The three logicoperatorsinJava are: Mark forReview (1) Points &&, ||, ! (*) !=,=,== &&,!=,= &,|,= Correct 15. The six relational operatorsinJavaare: Mark for Review (1) Points >,<,=,!,<=,>= >,<,==,!=,<=,>= (*) >,<,=,!=,<=,>= >,<,=,!=,=<,=> Correct Previous Page 3 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section5 16. All of the followingare essential toinitializingaFORloop,exceptwhichone? Mark for Review (1) Points Initializingthe iterator(i). Havinga conditional statement.
  • 7. Updatingthe counter. Havingan if statement.(*) Correct 17. Updatingthe inputof a loopallowsyoutoimplementthe code withthe nextelementrather than repeatingthe code alwayswiththe same element.True orfalse? Mark for Review (1) Points True (*) False Correct 18. What isthe outputof the followingcode segment? intnum = 7; while(num>=0) { num-= 3; } System.out.println(num); Mark for Review (1) Points -2 (*) 1 0 2 Correct 19. Why are loopsuseful? Mark forReview (1) Points Theysave programmersfromhavingto rewrite code. Theyallowforrepeatingcode a variable numberof times. Theyallowforrepeatingcode until acertainargumentismet. All of the above.(*) Incorrect.RefertoSection5 Lesson1. 20. Whichof the followingcallsthe methodcalculate correctly?
  • 8. Mark for Review(1) Points ThisClasst=newThisClass();intx=t.calculate(3,4);(*) int x=calculate(3,4); ThisClasst=newThisClass();intx=t.calculate(3); ThisClasst=newThisClass();intx=t.calculate(); Incorrect.RefertoSection5 Lesson2. Previous Page 4 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section5 21. A classcan onlyhave one constructor.True or false? Mark for Review (1) Points True False (*) Correct 22. What value will returnforj whenthe setValue methodiscalled?
  • 9. Mark for Review(1) Points 31 32 10 11 (*) Correct 23. The followingstatementcompilesandexecutes.Whatdoyouknow for certain? tree.grows(numFeet); Mark for Review(1) Points numFeetmustbe an int. tree must be the name of the class. grows mustbe the name of an instance field. grows mustbe the name of a method.(*) tree must be a method. Correct 24. The followingcode createsanObjectof type Animal.True orfalse? Animal a=newAnimal(); Mark for Review (1) Points True (*) False Correct
  • 10. 25. The followingcode createsanObjectof type Horse.True or false? Whale a=newWhale(); Mark for Review (1) Points True False (*) Correct Previous Page 5 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,and questionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section5 26. The followingcode isagoodexample of usingthe thisreference.True orfalse? Mark for Review(1) Points True False (*) Correct Section6 27. The followingarraydeclarationisvalid.True orfalse? int[] y= newint[5]; Mark forReview(1) Points True (*) False Correct 28. What isthe outputof the followingsegmentof code? Mark forReview (1) Points
  • 11. 456789 777777 (*) 555555 987654 Thiscode doesn'tcompile. Correct 29. Whichof the followingstatementsisnota validarraydeclaration? Mark for Review (1) Points int number[]; float[]averages; double marks[5]; counterint[];(*) Incorrect.RefertoSection6 Lesson1. 30. What isthe outputof the followingsegmentof code? intarray[][] = {{1,2,3},{3,2,1}}; for(inti=0;i<2;i++) for(intj=0;j<3;j++) System.out.print(2*array[1][1]); Mark forReview (1) Points 444444 (*) 123321 246642 222222 This code doesn'tcompile. Correct Previous Page 6 of 10 Next Summary
  • 12. Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section6 31. Considerthe followingcode snippet Stringforest= newString("Black"); System.out.println(forest.length()); What isprinted? Mark for Review(1) Points 5 (*) 6 7 Black Forest Correct 32. Whichof the followingcreatesaStringnamedChar? Mark for Review (1) Points char string; StringChar; (*) char Char; char char; Stringchar; Correct 33. The followingcode isanexample of acorrectinitializationstatement: char c="c"; Mark for Review(1) Points True False (*) Correct 34. The == operatorcan be usedto compare twoStringobjects.The resultisalwaystrue if the two stringsare have the exactsame characters ineach positionof the String.True or false? Mark for Review(1) Points
  • 13. True False (*) Correct 35. Whichof the followingcouldbe areasonto throw an exception? Mark for Review (1) Points To eliminate exceptionsfromdisruptingyourprogram.(*) You have a fatal errorin yourprogram. You have encounteredaStackOverflow Error. To make the userinterface hardertonavigate. Correct Previous Page 7 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section6 36. Whichof the followingcorrectlymatchesthe symbol withitsfunction? Mark for Review (1) Points (Choose all correctanswers) == (twoequal signs) comparesvaluesof primitivetypessuchasintor char. (*)
  • 14. == (twoequal signs) comparesthe valuesof non-primitiveobjects. == (twoequal signs) comparesthe memorylocationof non-primitiveobjects.(*) = (single equalssign) comparesthe value of primitive typessuchasint or char. .equals()comparesthe value of non-primitive objects.(*) Correct 37. If an exceptionisthrownbya method,where canthe catch for the exceptionbe? Mark for Review (1) Points There doesnot needtobe a catch inthissituation. The catch must be inthe methodthat threw the exception. The catch can be inthe methodthat threw the exceptionorinanyothermethodthatcalledthe methodthatthrewthe exception.(*) The catch must be immediatelyafterthe throw. Incorrect.RefertoSection6 Lesson3.
  • 15. 38. Suppose youare writinga programwhere the userispromptedtothe give coordinateswhere theybelievethe princessisinside of the castle. Your program movesthe prince tothe coordinatesthatthe user specified.If the princessisnot foundat those coordinates,the userisgivenaclue thathelpsthemguesscoordinatesclosertothe princess.The userisallowedto entertheirnew guessof where the princessis. Assume yourprogramdoesnot take intoconsiderationthe possibilitythatthe usermayenter coordinatesoutside of the castle where the princesscouldnotbe.Whatwouldbe the resultof the userenteringcoordinatesoutside of the castle?How couldthisbe handledinyourcode? Mark for Review (1) Points (Choose all correctanswers) Anerror wouldoccur.Errors cannot be handledbycode. Anexceptionwouldoccurbutcouldnot be handledinside yourcode.The userwouldhave to restartthe programand enterpropercoordinates. Anexceptionwouldoccur.Thiscouldbe handledbythrowingthe exceptioninyourcode if the userentersinvalidcoordinates.Whenthe exceptioniscaught,the prince couldbe movedtothe coordinate inside the castle thatisclosesttothose thatthe userspecified.(*) Anexceptionwouldoccur.Thiscouldbe handledbythrowinganexceptioninyourcode if the userentersinvalidcoordinates.Whenthe exceptioniscaught,the usercouldbe promptedtoenter coordinateswithinthe givenrange of the castle.(*) Incorrect.RefertoSection6 Lesson3.
  • 16. Section7 (Answerall questionsinthissection) 39. Anaccess modifierisakeywordthatallowssubclassestoaccessmethods,data,and constructorsfrom theirparentclass.True or false? Mark forReview (1) Points True (*) False Incorrect.Referto Section7 Lesson3. 40. Whichof the followingisthe correctway tocall an overridenmethodneedOil() of asuperclass Robotin a subclassSqueakyRobot? Mark for Review (1) Points Robot.needOil(SqueakyRobot); SqueakyRobot.needOil(); super.needOil();(*) needOil(Robot); Incorrect.RefertoSection7 Lesson3. Previous Page 8 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestionscoresbelow.Anasterisk(*) indicatesacorrect answer. Section7 (Answerall questionsinthissection) 41. What isthe JavaApplet? Mark for Review (1) Points (Choose all correctanswers) It isthe virtual machine thattranslatesJavacode intoa representationthatthe computercan understand. A web-basedJavaprogramthatis embeddedintoawebbrowser.(*) A graphic visual includedinJava.(*) There isno suchthingas a JavaApplet. Incorrect.RefertoSection7 Lesson3.
  • 17. 42. Whichsegmentof code representsacorrectway to define avariable argumentmethod? Mark forReview(1) Points StringeasyArray(String...elems){//code} (*) StringeasyArray(...Stringelems){//code} String...easyArray(Stringelems){//code} IntegereasyArray...(intelems) {//code} Correct 43. Whichof the followingisthe correctway tocode a methodwitha returntype an object Automobile? Markfor Review(1) Points Automobileupgrade(StringcarA){ carA="Turbo"; returncarA;} Automobile upgrade(Automobile carA){ carA.setTurbo("yes"); returncarA;} (*) Stringupgrade(StringcarA){ carA="Turbo"; returncarA;} upgrade(Automobile carA) Automobile{ carA.setTurbo("yes"); returncarA;} None of the above.Itisnot possible toreturnanobject. Correct
  • 18. 44. Choose the correctimplementationof apublicaccessmodifierforthe methoddivide. Mark for Review(1) Points divide(inta,intb,public) {returna/b;} publicdivide(inta,intb) {returna/b;}(*) divide(inta,intb) {publicreturna/b;} divide(publicinta,publicintb) {returna/b;} Correct 45. Staticmethodscan readinstance variables.True orfalse? Mark for Review (1) Points True False (*) Correct Previous Page 9 of 10 Next Summary Test:Java FundamentalsFinal Exam Reviewyouranswers,feedback,andquestion scoresbelow.Anasterisk(*) indicatesacorrect answer. Section7 (Answerall questionsinthissection) 46. Staticmethodscan write toclass variables.True orfalse? Mark for Review (1) Points True (*) False Incorrect.RefertoSection7 Lesson2. 47. A staticvariable isalwayspubliclyavailable.True orfalse? Mark for Review (1) Points True False (*) Correct 48. Abstractclassescannotimplementinterfaces.True orfalse? Mark for Review (1) Points True False (*) Incorrect.RefertoSection7 Lesson4.
  • 19. 49. If Oak extendsTree,itispossibletodeclare anobjectsuchthat Tree grandfatherT= newOak(); True or false? Mark for Review(1) Points True (*) False Correct 50. Abstractclass cannotextendanotherabstractclass.True or false? Mark for Review (1) Points True False (*) Correct Previous Page 10 of 10 Summary