View Single Post
  #6 (permalink)  
Old 12-05-2008, 10:48 AM
Nicholas Jordan's Avatar
Nicholas Jordan Nicholas Jordan is offline
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 1,018
Rep Power: 3
Nicholas Jordan is on a distinguished road
Exclamation [] not Array
Originally Posted by xcallmejudasx View Post
Code:
Array[] someArray = new Array[10];
Code:
C:\src_jdk1.5.0_12\java\lang\AbstractMethodError.java
C:\src_jdk1.5.0_12\java\lang\AbstractStringBuilder.java
C:\src_jdk1.5.0_12\java\lang\Appendable.java
C:\src_jdk1.5.0_12\java\lang\ArithmeticException.java
C:\src_jdk1.5.0_12\java\lang\ArrayIndexOutOfBoundsException.java
C:\src_jdk1.5.0_12\java\lang\ArrayStoreException.java
C:\src_jdk1.5.0_12\java\lang\AssertionError.java
C:\src_jdk1.5.0_12\java\lang\AssertionStatusDirectives.java
C:\src_jdk1.5.0_12\java\util\Arrays.java
C:\src_jdk1.5.0_12\java\util\ArrayList.java
Where's
Code:
class Array{}
?

nope, it's [] pretty much anything can have [] which makes an array of whatever it is close to.

I prefer the [] to be appended to the type as the varable is an array of the type declared to be arrayed.

Note that this declaration does not put anything in the array, to do that we either use a loop or in some fashion put Objects or primitive in each unit of the array.

In general, do if((array = null)&&(array.length > 0)&&(array[0] > minValue)&&(array[0] < maxValue)){......}else{error} then wrap the whole code block in a try / catch .....

To do anything cheaper than that will keep you buying books at the mall and placing them to impress people, rather than getting shippable code.

Remember, it always fails on rollout to your boss's most important customer: Even the Great Gates had a bluescreen of death on a network feed.

Code accordingly or keep your resume for flippin burgers current.
__________________
Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Last edited by Nicholas Jordan; 12-05-2008 at 10:49 AM. Reason: Array / Arrays
Reply With Quote