Why they used ; to end statements in Java/C++

放肆的年华 提交于 2019-12-04 17:03:18

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

EDIT: see https://softwareengineering.stackexchange.com/questions/139482/why-are-statements-in-many-programming-languages-terminated-by-semicolons#139485

... 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

http://en.wikipedia.org/wiki/Semicolon#Computing_usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!