As soon as an array is created using a new operator, its elements are automatically initialized to their default values. This automatic initialization of the elements depends on the data type of the array. The following table shows the initial value of the elements of an array:
| boolean | false |
| byte | 0 |
| short | 0 |
| int | 0 |
| long | 0L |
| char | ‘u0000′ |
| float | null |
| double | 0.0D |
| Object reference | null |
- Download free practice test for master-ciw-enterprise-developer Master CIW Enterprise Developer exam.
- Download free practice test for scbcd SCBCD exam.
- Click here to download scdjws test study guide and practice question.
- Download practice question and study guide for scja for exam.
- Click here to get free scjp SCJP exam practice questions.
- Click here to get free scjp-5-0 SCJP 5/6 exam practice questions.
- Download free practice test for SUN SCMAD exam.
- Get certified in first attempt download scwcd - SCWCD simulation.
- Download free practice test for SUN SCJP 2 exam.
- Click here to download CX310-019 test study guide and practice question.
- Pass SCJP 1.4 Upgrade in first attampt.
- Get certified in first attempt download CX310-055 - Java 5.0 simulation.