A.Thecodecompilesand“s=”isprinted.
B.Thecodecompilesand“s=null”isprinted.
C.Thecodedoesnotcompilebecausestringsisnotinitialized.
D.Thecodedoesnotcompilebecausestringscannotbereferenced.
E.Thecodecompiles,butaNullPointerExceptionisthrownwhentoStringiscalled.
第1题:
A.Anexceptionisthrown.
B.Thecodedoesnocompile.
C.“HelloWorld.”Isprintedtotheterminal.
D.Theprogramexitswithoutprintinganything.
第2题:
A.Theprogramrunsandprintsnothing.
B.Theprogramrunsandprints“Equal”
C.Anerroratline5causescompilationtofail.
D.Theprogramrunsbutabortswithanexception.
第3题:
A.Theprogramrunsandprintsnothing.
B.Theprogramrunsandprints“Finally”
C.Thecodecompiles,butanexceptionisthrownatruntime.
D.Thecodewillnotcompilebecausethecatchblockismissing.
第4题:
A.Theprogramrunsandprints“Hello”
B.Anerrorcausescompilationtofail.
C.Theprogramrunsandprints“Helloworld!”
D.Theprogramrunsbutabortswithanexception.
第5题:
A.Thecodecompilesand“s=”isprinted.
B.Thecodecompilesand“s=null”isprinted.
C.Thecodedoesnotcompilebecausestringsisnotinitialized.
D.Thecodedoesnotcompilebecausestringscannotbereferenced.
E.Thecodecompiles,butaNullPointerExceptionisthrownwhentoStringiscalled.