Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. ×
User Journal

Journal FortKnox's Journal: Java wierdness.... wtf? 7

Check this out.
That's a method on the java.lang.System object. WTF? Doesn't that belong in the java.util.Arrays class?

My only guess is that it manipulates low level memory to make the copy go 'fast', but still.... arraycopy on the System object just makes me queezy...
This discussion has been archived. No new comments can be posted.

Java wierdness.... wtf?

Comments Filter:
  • It's been there since version 1.0, IIRC...

    • Naw, I use javadoc a ton... just never really looked at System before. Only used 'out', 'err' and 'gc()'.
      • I had a lot to do with the System library, hence I've seen pretty much all of the javadoc. Problem with javadoc and me is the following: it is as addictive as wikipedia for me. I start reading, clik open a few tabs, continue reading... etc... etc... Quite a bad habit if you've got lots to code.

  • java.lang.System.arraycopy has been around since Java first went public. java.util.Arrays has only been there since 1.2. If the Arrays class had been in there since the beginning, arraycopy would probably have been there. As it was, it didn't really fit anywhere so they found java.lang.System as a place to stick it.
  • Okay, I'm not going to cite the source, because I could be making this up, or it applied to Java -3.8 from the year 1985, but I remember reading that just iterating over an array using the standard for(int i=0:iarray.length;i++) is/was/could be faster than using System.arraycopy.
  • I think there's usually an architecture dependant fast array copy method, this may be the accessor for it since it's System dependant.

Real computer scientists don't comment their code. The identifiers are so long they can't afford the disk space.

Working...