Given:
Which code fragment can replace the if block?
A.
stuff.equals (“TV”) ? res= “Walter” : stuff.equals (“Movie”) ? res = “White” :
res = “No Result”;
B.
res = stuff.equals (“TV”) ? “Walter” else stuff.equals (“Movie”)? “White” : “No
Result”;
C.
res = stuff.equals (“TV”) ? stuff.equals (“Movie”)? “Walter” : “White” : “No
Result”;
D.
res = stuff.equals (“TV”)? “Walter” : stuff.equals (“Movie”)? “White” : “No
Result”;
D
D