About 50 results
Open links in new tab
  1. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · This answer fails to properly address the question: "How do I declare and initialize an array in Java?" Other answers here show that it is simple to initialize float and int arrays when they …

  2. How to initialize an array in Java? - Stack Overflow

    Dec 21, 2009 · Notice the difference between the two declarations. When assigning a new array to a declared variable, new must be used. Even if you correct the syntax, accessing data[10] is still …

  3. java - Difference between int [] array and int array - Stack Overflow

    Oct 24, 2010 · I have recently been thinking about the difference between the two ways of defining an array: int[] array int array[] Is there a difference?

  4. java - Any way to declare an array in-line? - Stack Overflow

    Feb 28, 2016 · array("blah", "hey", "yo") with the type automatically inferred. I have been working on a useful API for augmenting the Java language to allow for inline arrays and collection types.

  5. java - Initializing an array after the declaration - Stack Overflow

    Java arrays are full-fledged objects with all that implies. For now the main thing it implies is that we have to allocate them with new. Initializing Arrays Individual elements of the array are referenced by the …

  6. Java Array Declaration Bracket Placement - Stack Overflow

    Jul 9, 2009 · In java your array declaration can be after the type or the name of the variable, so it is ok both methods to perform the same functionality. args are used to store command line arguments.

  7. Syntax for creating a two-dimensional array in Java

    int array[] = new int[5]; where int is a data type, array [] is an array declaration, and new array is an array with its objects with five indexes. Like that, you can write a two-dimensional array as the following.

  8. C++ and Java array declaration/definition - Stack Overflow

    Sep 25, 2015 · A three-dimensional array in Java is merely a one-dimensional array of references to arrays of references to arrays of whatever base type you wanted. Or in C++ speak, an array in Java, …

  9. Creating an array of objects in Java - Stack Overflow

    There are 3 steps to create arrays in Java - Declaration – In this step, we specify the data type and the dimensions of the array that we are going to create. But remember, we don't mention the sizes of …

  10. How does the Java array argument declaration syntax "..." work?

    I believe this was implemented in Java 1.5. The syntax allows you to call a method with a comma separated list of arguments instead of an array.