Originally Posted by xcallmejudasx
|
|
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
?
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.