-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
generic
-
generic
This program should compile:
public class Test {
public void saveA (AbstractClass<?> busObj) {
// Error here
ConcreteClass sqlA = (ConcreteClass) busObj;
}
}
abstract class AbstractClass<B> {
public abstract void doSomething (B b);
}
class ConcreteClass extends AbstractClass<String> {
public void doSomething (String b) {
}
}
See http://forum.java.sun.com/thread.jspa?threadID=636425&tstart=0
###@###.### 2005-06-15 18:03:19 GMT
public class Test {
public void saveA (AbstractClass<?> busObj) {
// Error here
ConcreteClass sqlA = (ConcreteClass) busObj;
}
}
abstract class AbstractClass<B> {
public abstract void doSomething (B b);
}
class ConcreteClass extends AbstractClass<String> {
public void doSomething (String b) {
}
}
See http://forum.java.sun.com/thread.jspa?threadID=636425&tstart=0
###@###.### 2005-06-15 18:03:19 GMT
- duplicates
-
JDK-4916620 legal cast is rejected
- Closed