About 542,000 results
Open links in new tab
  1. Java - How do I make a String array with values?

    Dec 18, 2011 · Another way to create an array with String apart from. String[] strings = { "abc", "def", "hij", "xyz" }; is to use split.

  2. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · Static Array: Fixed size array (its size should be declared at the start and can not be changed later) Dynamic Array: No size limit is considered for this. (Pure dynamic arrays do …

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

    Apr 1, 2010 · You can always write it like this . String[] errorSoon = {"Hello","World"}; For (int x=0;x<errorSoon.length;x++) // in this way u create a for loop that would like display the …

  4. string to string array conversion in java - Stack Overflow

    Jun 5, 2020 · To continue this train of thought, you could then convert the char array to a String array: String[] stringArray = new String[charArray.length]; for (int i = 0; i < charArray.length; …

  5. Convert array of strings into a string in Java - Stack Overflow

    Apr 7, 2011 · Java 8+ Use String.join():. String str = String.join(",", arr); Note that arr can also be any Iterable (such as a list), not just an array.

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

    Jul 23, 2017 · @Terence: It does the same as the first: It creates an array of string array references, initialized to the values array1, array2, array3, array4 and array5 - each of which is …

  7. java - How to convert a char array back to a string ... - Stack …

    Apr 11, 2015 · A String in java is merely an object around an array of chars. Hence a. char[] is identical to an unboxed String with the same characters. By creating a new String from your …

  8. Converting String to "Character" array in Java - Stack Overflow

    Apr 4, 2012 · I want to convert a String to an array of objects of Character class but I am unable to perform the conversion. I know that I can convert a String to an array of primitive datatype type …

  9. java - User input stored in a String array - Stack Overflow

    Since you know that you want to have an array of 20 string: String[] array = new String[20]; Then your for loop should use the length of the array to determine when the loop should stop. Also …

  10. What's the simplest way to print a Java array? - Stack Overflow

    Since Java 5 you can use Arrays.toString(arr) or Arrays.deepToString(arr) for arrays within arrays. Note that the Object[] version calls .toString() on each object in the array.

Refresh