jls
Java casting: is the compiler wrong, or is the language spec wrong, or am I wrong?
I have been reading the Java Language Spec, 3rd edition, and have found what I think is a discrepancy between the spec and the javac compiler implementation. The same discrepancies exist in the Eclips[详细]
2023-02-18 02:15 分类:问答Why doesn't a Java constant divided by zero produce compile time error? [duplicate]
This question already has answers here: Closed 12 years ago. Possible Duplicate: Is 1/0 a legal Java expression?[详细]
2023-02-10 07:30 分类:问答Why Java methods with varargs identified as transient?
I was playing with Java Reflection API and observed that methods with variadic argument list become transient. Why is that and what does transient keyword mean in this context?[详细]
2023-02-09 21:17 分类:问答What is the drawback of having more instances of enum type other than in the enum declaration?
It is a compile-time error to attempt to explicitly instantiate an enum type (§15.9.1). The final clone method in Enum ensures that enum constants can never be cloned, and the special treatment by t[详细]
2023-02-07 14:27 分类:问答In Java, can a method/constructor declaration appear inside another method/constructor declaration?
In Java, can a method/constructor declaration appear inside another method/constructor declaration? Example:[详细]
2023-02-05 06:28 分类:问答Cases where the imports in Java aren't needed (unusual qualification) [Question Edited]
I\'ve noticed there are some special ways to qualify an entity in Java: Object o = new Outer().new Inner();[详细]
2023-02-04 19:07 分类:问答In Java, why can't I write i++++ or (i++)++?
When I try to write a postfix/prefix in/decrement, followed by a post/prefix in/decrement, I get the following error: Invalid argument to operation ++/--.[详细]
2023-02-04 13:21 分类:问答Java "fresh type variable"
What does \"fresh type variable\" mean in the JLS Co开发者_如何学JAVAnversions and Promotions chapter? Fresh is the common designation for a variable that must not have been used before.[详细]
2023-01-16 07:33 分类:问答Are subcontexts in Java separate rows on the stack?
In Java this is the case: public void method() { if (condition) { Object x = ....; } System.out.println(x); // Error: x unavailable[详细]
2023-01-04 00:10 分类:问答Are there any guarantees in JLS about order of execution static initialization blocks?
I wonder if it\'s reliable to use a construction like: private static final Map<String, String> engMessages;[详细]
2023-01-03 10:01 分类:问答