About 182,000 results
Open links in new tab
  1. How do I declare and initialize an array in Java?

    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 …

  2. java - Convert an integer to an array of digits - Stack Overflow

    I try to convert an integer to an array. For example, 1234 to int[] arr = {1,2,3,4};. I've written a function: public static void convertInt2Array(int guess) { String temp = Integer.toString(g...

  3. add an element to int [] array in java - Stack Overflow

    Apr 9, 2013 · The size of an array can't be changed. If you want a bigger array you have to create a new array. However, a better solution would be to use an (Array)List which can grow as you …

  4. java - int[] and Integer[] arrays - What is the difference? - Stack ...

    Sep 17, 2013 · Integer is an object. When you have an array of Integers, you actually have an array of objects. Array of ints is an array of primitive types. Since arrays are objects, they're …

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

    Yes ! this is to be mention that converting an array to an object array OR to use the Object's array is costly and may slow the execution. it happens by the nature of java called autoboxing. So …

  6. Convert String to int array in java - Stack Overflow

    Feb 27, 2022 · substring removes the brackets, split separates the array elements, trim removes any whitespace around the number, parseInt parses each number, and we dump the result in …

  7. Java, Simplified check if int array contains int - Stack Overflow

    Aug 18, 2012 · Find an integer in an Array in a short manner in Java. 0. Checking if an array contains certain integers. 0.

  8. How to convert int [] into List<Integer> in Java? - Stack Overflow

    Jul 2, 2009 · Arrays.asList will not work as some of the other answers expect. This code will not create a list of 10 integers.

  9. Convert an integer to an array of characters : java

    What is the best way to convert an integer into a character array? Input: 1234 Output: {1,2,3,4} Keeping in mind the vastness of Java language what will be the best and most efficient way of …

  10. What is the default initialization of an array in Java?

    Java says that the default length of a JAVA array at the time of initialization will be 10. private static final int DEFAULT_CAPACITY = 10; But the size() method returns the number of …

Refresh