Why semicolon is not required after a curled bracket?
问题 I know that a semicolon is required after a statement (I'm talking about Java, C++, and similar languages), but is not required after a curled bracket. Why so? if (a > b) printf("hello!"); // semicolon is mandatory if (a > b) { printf("hello!"); } // semicolon is not required What is the reason? I mean, what is the theory behind this? 回答1: Because curly brackets are used for grouping statements, but they are not statements themselves. 回答2: Because the language is defined as: statement: