Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

arrays.fill java

import java.util.Arrays;
int[] myArray = new int[10];
Arrays.fill(myArray,1);//This will fill the array with 1s
Comment

java how to fill an array

int array[] = {6, 7, 8, 9, 10};
Arrays.fill(array, 5);
Comment

fill array java

// fill array with counter (for loop) (1,2,3,4,5)
 int[] myArray = new int[5];
 for (int i = 0; i < myArray.length; i++) {
	 myArray[i] = i + 1;
 }
Comment

PREVIOUS NEXT
Code Example
Java :: java char stream to string 
Java :: what is jvm jdk and jre 
Java :: how to initialize a string in java 
Java :: list.of java 
Java :: java swing get frame size 
Java :: how to get elements of a list in java 
Java :: how to check if a person pressed a buuton in jframe 
Java :: java newinstance alternative 
Java :: how to find the largest number in java 
Java :: reverse negative number 
Java :: java instantiate a scanner 
Java :: convert class to java command line 
Java :: Java Exception handling using Java throw 
Java :: how to create set java 
Java :: convert object array to int array java 
Java :: java get enum by ordinal 
Java :: get all enum values java 
Java :: 2 decimal places print format JAVA 
Java :: reader 
Java :: can i call another function from main hava 
Java :: Arraylist in java by dc 
Java :: practical1_answer 
Java :: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config 
Java :: hasNext for scanner class java 
Java :: infinite value total 
Java :: setimageuri crash 
Java :: boolean 
Java :: android activity keyboard hide 
Java :: maths.abs function in java 
Java :: how to disable the cors in spring boot 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =