Forum Stats

  • 3,852,844 Users
  • 2,264,142 Discussions
  • 7,905,157 Comments

Discussions

System.arrayCopy with generics

843793
843793 Member Posts: 41,732 Green Ribbon
edited Aug 18, 2002 1:16AM in Generics
I am new to generics. Could anybody show me a class/method like System.arrayCopy that would work with any primitive arrays using generics?

Comments

  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    Unfortunately, nobody can provide you with a solution that uses generics because the current generics proposal in Java simply does not allow primitive types to be used in generic parameters. Only objects.

    Sorry. The answer is that it's impossible, unless the generics team at Sun decides to implement generics completely differently.
This discussion has been closed.