Answer is D.
Source code:
public static void main(String[] args) {
String stuff = "TV";
String res = null;
if (stuff.equals("TV")) {
res = "Walter";
} else if (stuff.equals("Movie")) {
res = "White";
} else {
res = "No Result";
}
System.out.println(res);
res = stuff.equals ("TV") ? "Walter" : stuff.equals ("Movie") ? "White" : "No Result" ;
System.out.println(res);
}
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
NiFo
7 months, 2 weeks agoa_really_reliable_programmer
5 months agoVicky_65
10 months agoCreazyyyyGirl
10 months, 3 weeks agocarloswork
1 year, 3 months ago