Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
Array Initializers

Java Language Specification, Version Java SE 21 Edition
10.6. Array Initializers

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-10.html#jls-10.6

5 Documented Misconceptions

Misconception
ArrayAllocationWithoutNew
Arrays are created without the new keyword
Misconception
ArrayBracketCountIsLength
The number of brackets in an array type or an array initializer corresponds to the length of the array
Misconception
ArrayLengthCannotBeZero
An array cannot have a length of 0 elements
Misconception
ArrayInitializerContentsInBrackets
Array initializers list the elements in square brackets
Misconception
NoJaggedArrays
Multi-dimensional arrays have a rectangular shape

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors