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

    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 · It takes an array, as a parameter (and also has overloads for Iterable and Iterator parameters) and calls toString() on each element (if it is not null) to get each elements string …

  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 - Create a two dimensional string array anArray [2] [2] - Stack ...

    Dec 3, 2013 · The question: 3. Create a Java program called TwoDimArray and implement the following: Create a two dimensional string array anArray[2][2]. Assign values to the 2d array …

  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