Please someone tell me why Generics fail this time because this thing will course major issues one day
[My Blog]
All roads lead to JavaRanch
Java Programmer | SCJP 1.5 | SCWCD 1.4
Srikanth Kumar
SCJP 5, SCWCD 5, SCDJWS 5
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Like thisRob Prime wrote:Every good compiler / IDE should give you a warning . . .
If you look in books like Effective Java by Bloch, you find that generics guarantees to avoid that sort of error provided there are no compiler warnings.campbell@Queeg:~/java/generic$ javac B.java
Note: B.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
campbell@Queeg:~/java/generic$
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Pubudu Dissanayake wrote: Thank you guys ....
In .net they have compile and runtime protection when you using generics but java only has runtime protection .
True but you can't avoid that kind of errors and why java didn't correct this problem .
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Maybe, just maybe, back in 1995 when Gosling and team were writing Java, they ran out of time or money.Pubudu Dissanayake wrote: . . . why java didn't correct this problem .
SCJP6.0,My blog Ranchers from Delhi
Don't get me started about those stupid light bulbs. |