【发布时间】:2022-12-27 21:52:03
【问题描述】:
I want to understand the use of semicolon in Java expressions, statements, expressions or in for loop? and I want to know what is the memory consumption for the semicolon.
int a = 1;
for(int a=0; a <1;a++)
etc
If I remove the semicolon gives below errors
java: ';' expected
【问题讨论】:
-
A semicolon is used to end an expression statement. The language says you need one, so why are you surprised when you get a syntax error by omitting it? About memory usage, what do you mean?