Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
User Journal

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

Journal by FortKnox
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...

    • by FortKnox (169099) *
      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.

If a 6600 used paper tape instead of core memory, it would use up tape at about 30 miles/second. -- Grishman, Assembly Language Programming

Working...