Java Generics with existing classes -


i don't have actual problem, playing around java generics , realized if create class generics, can use name generic part of class (so inside <>), treated non-existing class, variable.

so if use string generic part, won't string anymore, example can't use charat() method.

i guess, feature, because normally, if know want use string use it, , don't create generic class.

am right?

you can still use classes same name if use full name including package, e.g. java.lang.string.

the issue same if create class named string in package. can that, need live consequences classes in same package use class instead of standard string class.


Comments