I've been asked to "Identify all language constructs in Java. Your list should start with classes:
The body of class declarations"
I was under the impression that a 'language construct' was any allowable command in a language, but this is clearly not what is meant by the question. If anyone could give me a clearer understanding of what a language construct is in this context, and what kind of thing this list should contain, I would appreciate it.
Thanks in advance!
Well, according to Wikipedia, a language construct is "a syntactically allowable part of a program that may be formed from one or more lexical tokens in accordance with the rules of a programming language"
The phrase "language construct(s)" appears in the JLS once, in the Preface (excluding a mention in the index): "We intend that the behavior of every language construct is specified here..." This implies that every Java "language construct" is cataloged in the JLS. Combined with the Wikipedia definition, that would seem to cover everything from keywords and literal values; types, names, and variables; to packages, classes, interfaces, and class members like methods, fields, and constructors; blocks, statements, expressions... Take your pick. Just take a look through the ToC.