Computer Science, asked by harshithbabu39, 6 months ago

3. Predict the output from the following:
System.out.println("Teachers and \'Students are working hard
\t during this \n \” PANDEMIC"" ");​

Answers

Answered by srishtikaur57
1

Answer:

The argument of if statement should be Boolean type. By mistake if we are trying to provide any other data type then we will get compile-time error saying incompatible types. Here the argument is of int type, therefore we will get compile time error saying error: incompatible types: int cannot be converted to Boolean

Explanation:

Curly braces are optional in if part. Without curly braces only one statement is allowed under if. If we will try to give more than one statement then we will get compile time error saying error: ‘else’ without ‘if’.

Similar questions
Math, 3 months ago