Anil Philip wrote:I don't understand what you are talking about!
Anil Philip wrote:
Paul Clapham wrote:
Anil Philip wrote:
Campbell Ritchie wrote:Please don't quote the whole of the preceding post; that adds nothing and is liable to removal.
who are you referring to?
Let me just point out that the staff here can see all of the revisions which people have made to their posts. And they can revert them if they disapprove. I haven't reverted the one you're indirectly referring to yet.
I don't understand what you are talking about!
Campbell Ritchie wrote:There are only a few operators that associate right‑to‑left, or associate to the right. I am not sure, but as far as I remember, they are the unary operators, the conditional operator, and the assignment operators.
Campbell Ritchie wrote:Those JLS (=Java® Language Specification) links tell you, all with slightly different spellings, how those operators associate.
Campbell Ritchie wrote:That means thatis equivalent tobutis equivalent to
Jeanne Boyarsky wrote:I don't consider it an errata because an interface is a type of class.
Chirayu Gangadkar wrote:How should I manage static imports for classes that contain both static and instance members in nested packages? Will we encounter such questions in the exam?
Tim Holloway wrote:Your error message explains it.
You have an "import" in a place where "import" is not permitted.
Tim Holloway wrote:It would be pointless to include importing from the default package though. Aside from the fact that there's no special syntax for it, the default package would be the implicit location for unqualified classes not in the explicit package class path and therefore would need no explicit directive.
Chirayu Gangadkar wrote:Thank you for the detailed explanation! That clarifies things—static imports apply to any member that can normally be accessed using ClassName.member.
Chirayu Gangadkar wrote:Therefore, if I encounter a static import for something that is usually instance-based (like ArrayList.add()), I should immediately suspect a possible compilation error.
Chirayu Gangadkar wrote:Would you say that relying on method behaviour (mutating vs. non-mutating) and understanding class design is an effective strategy for identifying static methods in the exam? Or do you have any other quick tips to recommend?