18th Nov 2018, 5:10 PM
Ishaq Za'rour
6 Answers
+ 11
Coder #1 Regarding code quality, I also strongly believe that the semicolon (or any other explicit statement separator) helps with readability, as it clearly communicates the end of the statement. A statement is a unit of instruction (a line). In Java, that line ends with semicolon (;) So, yes, in your case you don't have any declaration ( int i; ) or expressions statements in code before semicolon! There's a "blank line", and it's end with (;)
18th Nov 2018, 7:26 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 10
Coder #1 👍You are welcome! 😊 I'm glad if I helped! 😉
18th Nov 2018, 7:30 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 9
Coder #1 Most, but not all, Java statements must end with a semicolon. The basic rule is that declaration and expression statements must end with a semicolon, but most other statement types do not. --> You don't have any declaration or expression statements in you code!! // before semicolon (;)
18th Nov 2018, 7:08 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 8
Semicolons simply terminate statements. Lines mean nothing to the javac compiler. Practicing proper indentation will make your code more readable, especially when your code blocks contain a lot of statements. https://code.sololearn.com/c59CIZ1qFj13/?ref=app
18th Nov 2018, 6:48 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 1
Danijel Ivanović you saying that the semicolon is terminating a blank line ??
18th Nov 2018, 7:10 PM
Ishaq Za'rour
+ 1
Danijel Ivanović thank you very much You've helped me alot
18th Nov 2018, 7:27 PM
Ishaq Za'rour