In English language we normally use a Period (. also called Full Stop) to terminate a statement.
Similarly in Java, a semicolon ; is used to terminate a statement.
For example:
int x = 3;
int y = x + 4;
System.out.println("Holla!");
If we miss the semicolon at the end of a statement, it is a syntax error. And while compiling, Java compiler will flag an error.
For example, click Submit on the below code without fixing the error and notice the compilation error. And later you can fix the problem and re-submit the code.
package q10800 :-
0 Comments