java - Raw stack vs. generic Stack<Character> -
it's not error, don't having warnings show in eclipse.
stack raw type. references generic type stack<e> should parameterized
i know can fix providing class character e, since i'll using .charat
, rather use <char>
because that's type charat
returns. there way me use char parameter, , if not, run casting problems using <character>
?
the reason have use character
, not char
generic type parameters in java cannot primitive types. there no way around that. if want use standard java collection framework, have put this.
as far warnings concerned:
they warnings, , can suppressed. can in source code (by using
@suppresswarning
annotations), or changing eclipse java compiler preferences.it possible write genericised equivalent usage of raw types.
Comments
Post a Comment