Should not they have used . to end a statement. They could use -> to call a method. Was this just a oversight? Or there is some deeper going on here?
Java picked the semicolon to have a syntax similar to C and C++.
C++ picked it to have a syntax similar to C.
And I would guess that C picked the semicolon because B, ALGOL and Pascal already used it, and there was no reason not to use an already accepted convention.
craniumonempty
... so people understand the comment (and negs), this was the original:
"Additionally, the semicolon stands for a NOP (no operation or null command) in C/C++" might give a clue as to why it's common
来源:https://stackoverflow.com/questions/10254588/why-they-used-to-end-statements-in-java-c