Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

arraycopy

 
Struan Kay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is probably just a 'because it is.' type question but is there any reason why the arraycopy method is in the java.lang.System class not java.util.Arrays and why isn't the c uppercase?

Thanks

Struan
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stuff in the java.lang.System class is pretty much the first defined in Java, and it predates java.lang.Arrays. I think because it came out first it is now pretty fundamental to so many Java programs that there is little chance for Sun to deprecate it.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, if you were curious if there existed some well thought out design considerations behind this situation, the answer is, "Probably not."
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and why isn't the c uppercase?

There may well exist some "historic" reason for it (e.g. something in the C or C++ programming language standard library with the same name and a similar function), but I'm not aware of such a thing.

I'd guess that someone just wasn't following the current naming conventions, and then it was too late to change, without affecting substantial existing code.
[ May 27, 2004: Message edited by: Dirk Schreckmann ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or maybe they wanted to have some exceptions to the rule to make the certification exam more "interesting"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic