java - Making a generic parameterized type of anything -
So I'm trying to create a parameter type which will work for any type of Java in it, It is an object, and this type of old type is
OK, suppose I want a primitive goal for each, so its
for (int i: MyClass)
Is such a thing possible?
Your comment on Bozho's answer is going on, you probably want to do something like this: / P>
Interface MyInterface & lt; T & gt; Offers exchange & lt; T & gt; {}
And no, you can not do this for primitive types, you can simulate an iterator for a primitive type, but it will never really be worth it, as Usable in each loop is usable.
Comments
Post a Comment