Computer Science, asked by sarkarsid, 8 months ago

Observe the below code.
int num1=10;
if(num1)
System.out.println("Hello");
else
System.out.println("Hai");
What is the output of the following code?
O Compilation Fails
О Hai
O
Hello​

Answers

Answered by Chandana008
3

Answer:

Hello

Explanation:

Non zero integer is taken as true.

Answered by syed2020ashaels
0

Answer:

There will be a Compilation Error

Explanation:

  • Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors in the code, or, more unusually, due to errors in the compiler itself. A compilation error message often helps programmers debugging the source code.
  • An internal compiler error (commonly abbreviated as ICE) is an error that occurs not due to erroneous source code, but rather due to a bug in the compiler itself. They can sometimes be worked around by making small, insignificant changes to the source code around the line indicated by the error.
    #SPJ2
Similar questions