and Verified Answers Guaranteed Pass
InheritanceAisAtheAprocessAofAsharingAmethodsAandAinstanceAvariablesAbetweenAaAbaseA
class
andAitsAsubclassesA(T/F).A-ACORRECTAANSWERSA-True
TheAnameAofAtheAtextAfileAwithAJavaAsourceAcodeAmustAmatchAtheAnameAofAtheAprogramA
withAa
.classAextensionA(T/F).A-ACORRECTAANSWERSA-False
BothAforAloopsAandAwhileAloopsAcanAbeAusedAasAcount-controlledAloopsA(T/F).A-
ACORRECTAANSWERSA-True
ItAisAillegalAtoAdeclareAseveralAvariablesAinAaAsingleAdeclaration,Ai.e.AintAa,Ab,Ac;A-
ACORRECTAANSWERSA-False
m++,Am=m+1,AandAm+=1AareAallAequivalentAexpressionsA(T/F).A-ACORRECTAANSWERSA-
True
TheAassignmentAoperatorA(A=A)AandAequalAtoAoperatorA(A==A)AcanAbeAusedAinterchangeablyA
(T/F).A-ACORRECTAANSWERSA-False
AAwhileAloopAwillAalwaysAexecuteAatAleastAonceA(T/F).A-ACORRECTAANSWERSA-False
TheAcounterAinAaAforAloopAisAupdatedAatAtheAbeginningAofAtheAloopA(T/F).A-
ACORRECTAANSWERSA-False
ItAisAillegalAtoAdeclareAtheAloopAcontrolAvariableAinsideAtheAforAloopAheaderA(T/F).A-
ACORRECTAANSWERSA-False
TheAforAstatementAcombinesAcounterAinitialization,AconditionAtestAandAcounterAupdateAintoA
aAsingleAexpressionA(T/F).A-ACORRECTAANSWERSA-True
ItAisAusuallyAsaferAtoAuseAtheA==AorA!=AoperatorsAinAloops,AratherAthanAtheAotherAlogicalAope
ratorsA(T/F).A-ACORRECTAANSWERSA-False
TheAidentityAofAanAobjectAisAsimplyAtheAvariableAthatAreferencesAtheAobjectA(T/F).A-
ACORRECTAANSWERSA-False
AAclass'sAimplementationAdetailsAcanAbeAchangedAradicallyAwithoutAaffectingAanyAofAitsAcli
entsAprovidedAitsAinterfaceAremainsAtheAsameA(T/F).A-ACORRECTAANSWERSA-True
TheAkeywordApublicAindicatesAthatAtheAclassAisAaccessibleAtoAallApotentialAclientsA(T/F).A-
ACORRECTAANSWERSA-True
ConstructorsAdoAnotAhaveAreturnAtypes,AbutAallAotherAmethodsAdoA(T/F).A-
ACORRECTAANSWERSA-True
AAclassAcanAincludeAonlyAoneAconstructorA(T/F).A-ACORRECTAANSWERSA-False
AAmethodAcanAonlyAhaveAoneAreturnAstatementA(T/F).A-ACORRECTAANSWERSA-False
TheAORAoperandAevaluatesAtoAfalseAifAoneAoperandAisAfalseA(T/F).A-
ACORRECTAANSWERSA-False
NestedAifAstatementsAofferAanAalternativeAtoAdealAwithAaAprogramsAlogicalAcomplexityA(T/F)
.A-ACORRECTAANSWERSA-True
JavaAusesAcompleteAevaluation,AinAwhichAallApartsAofAaABooleanAexpressionAareAalwaysAe
valuatedA(T/F).A-ACORRECTAANSWERSA-False
ConsiderAtheAfollowingAcodeAsegment:
, intAxA=A7;
intAyA=A3;
ifA(A(x<10)A&&A(y<0)A)
System.out.println("ValueAis:A"A+x*y);
else
System.out.println("ValueAis:A"A+Ax/y);A-ACORRECTAANSWERSA-ValueAis:A2
AssumeAthatAaAandAbAhaveAbeenAdefinedAandAinitializedAasAintAvalues.ATheAexpression
!(!A(a!=b)A&&A(b>7))
isAequivalentAtoAwhichAofAtheAfollowing?A-ACORRECTAANSWERSA-(aA!=Ab)A||A(bA<=A7)
ConsiderAtheAfollowingAcodeAsegment.
intAsumA=A0;
intAkA=1;
whileA(sumA<A12A||Ak<4)
sumA+=Ak;
System.out.println(sum);
WhatAisAprintedAasAaAresultAofAexecutingAtheAcodeAsegment?A-ACORRECTAANSWERSA-
NothingAisAprintedAdueAtoAanAinfiniteAloop.
ConsiderAtheAfollowingAcodeAsegment.
intAnumA=A2574;
intAresultA=A0;
whileA(numA>A0)A{
resultA=AresultA*A10A+AnumA%A10;
numA/=A10;
}
System.out.println(result);
WhatAisAprintedAasAaAresultAofAexecutingAtheAcodeAsegment?A-ACORRECTAANSWERSA-
4752
ConsiderAtheAfollowingAmethod.
publicAvoidAtestA(intAx)A{
intAy;
ifA(xA%A2A==0)
y=3;
elseAifA(x>9)
y=5;
elseA
yA=A1;
System.out.println("yA=A"A+Ay);
}
WhichAofAtheAfollowingAtestAdataAsetsAwouldAtestAeachApossibleAoutputAforAtheAmethod?A-
ACORRECTAANSWERSA-8,A9,A11
WhichAofAtheAfollowingAstatementsAwillAresultAinAaAsyntaxAerror?A-
ACORRECTAANSWERSA-IntegerAxA=A"123";
WhatAisAtheAresultAwhenAtheAfollowingAcodeAsegmentAisAcompiledAandAexecuted?
intAmA=4,AnA=A5;
doubleAdA=AMath.sqrt(A(mA+An)/2);
System.out.println(d);A-ACORRECTAANSWERSA-2.0