About 249,000 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. 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.

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

    Dec 21, 2009 · When assigning a new array to a declared variable, new must be used. Even if you correct the syntax, accessing data[10] is still incorrect (You can only access data[0] to data[9] …

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

    I am new to Java and for the time created an array of objects in Java. I have a class A for example -

  5. java - How to declare an ArrayList with values? - Stack Overflow

    ArrayList or List declaration in Java has questioned and answered how to declare an empty ArrayList but how do I declare an ArrayList with values? I've tried the following but it returns a syntax ...

  6. Initialising a multidimensional array in Java - Stack Overflow

    Jul 1, 2009 · What is the correct way to declare a multidimensional array and assign values to it? This is what I have:

  7. Double array initialization in Java - Stack Overflow

    I was reading a book on Java and came across an example in which an array of type double was initialized in a way that I haven't seen before. What type of initialization is it and where else can it...

  8. How to make an array of arrays in Java - Stack Overflow

    While there are two excellent answers telling you how to do it, I feel that another answer is missing: In most cases you shouldn't do it at all. Arrays are cumbersome, in most cases you are better off using …

  9. I want to declare an empty array in Java and then I want do update it ...

    35 I want to declare an empty array in Java and then I want do update it but the code is not working.

  10. Java: how to initialize String []? - Stack Overflow

    String[] errorSoon; // <--declared statement String[] errorSoon = new String[100]; // <--initialized statement You need to initialize the array so it can allocate the correct memory storage for the String …