Computer Science, asked by durgabhavanijami, 1 month ago

Jami Durga bhavani
COMPUTER SCIENC
17. Which statement is true?
3
public void sample(int n) {
int n=2;
if(n) {
System.out.println(good morning);
}
else {
System.out.println(good evening);
}
30
}
48
56
"good morning" will be printed
compilation fails
None of the above
"good evening" will be printed​

Answers

Answered by yashichauhan1302
0

Answer:

Compilation fails.

Explanation:

Neither the first nor the fourth statement is true because in the output statement, the message is not quoted within inverted commas, therefore, the statements inside the brackets are invalid.

Statement two is correct because in the program if we write only constants the compiler would not understand it.

Hey, I hope the answer is helpful. :)

Similar questions