arrays

Solutions on MaxInterview for arrays by the best coders in the world

showing results for - "arrays"
Filippo
21 Feb 2020
1// Java program to demonstrate working of Arrays.toString() 
2import java.io.*; 
3import java.util.*; 
4
5class GFG { 
6	public static void main(String[] args) 
7	{ 
8		// Let us create different types of arrays and 
9		// print their contents using Arrays.toString() 
10		boolean[] boolArr = new boolean[] { true, true, false, true }; 
11		byte[] byteArr = new byte[] { 10, 20, 30 }; 
12		char[] charArr = new char[] { 'g', 'e', 'e', 'k', 's' }; 
13		double[] dblArr = new double[] { 1, 2, 3, 4 }; 
14		float[] floatArr = new float[] { 1, 2, 3, 4 }; 
15		int[] intArr = new int[] { 1, 2, 3, 4 }; 
16		long[] lomgArr = new long[] { 1, 2, 3, 4 }; 
17		Object[] objArr = new Object[] { 1, 2, 3, 4 }; 
18		short[] shortArr = new short[] { 1, 2, 3, 4 }; 
19
20		System.out.println(Arrays.toString(boolArr)); 
21		System.out.println(Arrays.toString(byteArr)); 
22		System.out.println(Arrays.toString(charArr)); 
23		System.out.println(Arrays.toString(dblArr)); 
24		System.out.println(Arrays.toString(floatArr)); 
25		System.out.println(Arrays.toString(intArr)); 
26		System.out.println(Arrays.toString(lomgArr)); 
27		System.out.println(Arrays.toString(objArr)); 
28		System.out.println(Arrays.toString(shortArr)); 
29	} 
30} 
31
Anton
23 Nov 2020
1itemp:integer
2
Federico
31 Sep 2018
1arrays
2
Gauthier
31 Jan 2021
1//Javascript Array
2var fruitList = ["Bananas", "Apples", "Oranges"]
Nicolás
25 Jul 2020
1// Java program to demonstrate working of Arrays.toString() 
2import java.io.*; 
3import java.util.*; 
4
5class GFG { 
6	public static void main(String[] args) 
7	{ 
8		// Let us create different types of arrays and 
9		// print their contents using Arrays.toString() 
10		boolean[] boolArr = new boolean[] { true, true, false, true }; 
11		byte[] byteArr = new byte[] { 10, 20, 30 }; 
12		char[] charArr = new char[] { 'g', 'e', 'e', 'k', 's' }; 
13		double[] dblArr = new double[] { 1, 2, 3, 4 }; 
14		float[] floatArr = new float[] { 1, 2, 3, 4 }; 
15		int[] intArr = new int[] { 1, 2, 3, 4 }; 
16		long[] lomgArr = new long[] { 1, 2, 3, 4 }; 
17		Object[] objArr = new Object[] { 1, 2, 3, 4 }; 
18		short[] shortArr = new short[] { 1, 2, 3, 4 }; 
19
20		System.out.println(Arrays.toString(boolArr)); 
21		System.out.println(Arrays.toString(byteArr)); 
22		System.out.println(Arrays.toString(charArr)); 
23		System.out.println(Arrays.toString(dblArr)); 
24		System.out.println(Arrays.toString(floatArr)); 
25		System.out.println(Arrays.toString(intArr)); 
26		System.out.println(Arrays.toString(lomgArr)); 
27		System.out.println(Arrays.toString(objArr)); 
28		System.out.println(Arrays.toString(shortArr)); 
29	} 
30} 
Ty
16 Jan 2020
1int[] numbers = new int[10];
2
3int[] names = new String[]{"John", "Jack"};
4
5int length = names.length;
6
7for (String name: names) {
8    System.out.println(name);
9}
similar questions
what is array 3farray
queries leading to this page
describe an array in javascriptjs array 2 elementsarray syntaxarray java fix elements 5b 5d arrayhow to set array component value in javascriptarrat objectarray s 5cwhat does do in java arrayarrays iarray is number javascriptarray definedoes javascript have listsarray list in jslist elements of an array by namedefine arraysarraylist in jsarrays in java for beginnerswhat is an array javascriptjava fixed arrayarrays definitionarray java 10 elementsget element from array by index javascripttypes to create array in javascriptarray 28array 24how to access array in javascript objectarray manipulation javaarray of variable objects javascriptjs items 28i 29static void print content of array 28int array 5b 5d 2c int size 29 7b means in java 3farrays definearrays java 8javascript array inside and arrayjava 8 arrays tutorialindexing native arrays javaarray built in constructor javaobject with arrays javascriptjava c 5bi 5d 3d a 5bi 5d b 5bi 5d arraysarray creatation statemetnjs get array element by indexwhat is arraysin array jsvalue at certain point for arrays javaarrays jajs array inside arrayread one number from array on javaarraylists in jswhat is an element in arraywriting a js arraydeclare arrays in function jshow to get aaraycreate a arraydeclaring an arrayfetch data from array javascriptsout elements of array with indexes javaarrays 21 arraywhich of the following data structure store the homogeneous data elements 3fobject array javascriptarray in an arraywhat is array in javascriptarray array 22array 28 29java array manipulationhow to set array values in javascripthow to access an array of an arrayjava array key functionswhat is the type of an array javascriptarray arrayhow to make an arrayreturn array of elemetns jsarrayjs common name numbered elementsjava array indexjava array matharray 5c 5b 5c 5d 3bhow to write a function that takes in an array of strings javascripwhat is an arraywhich of the following data structure can 27t store the non homogeneous data elements 3farrays 28 3a 3a 29new array in jav a 10 lngthjs get element of array by indexarray arrayjavascript get element from arrayjs named array itemsarray position javascriptjava names arrayarrays explained basicshow to form an arrayarray element ofsyntax for of arrayarray 5b 5dloggin elements from array javascript which of the following data structure store the homogeneous data elements 3fcopy array into another 400when to learn the array class javahow to declare new elemnt in java maincreat new array array arrayswhat is array new array javascript and literalarray of variables jswhat ia an arrayjava 2a operator inside array index java array symbols 24 arrayarray array list in javascript classjs 5b 5dhow to get the element of an array object in javascriptjava script what is a arrayarray w3schoolslist string jssimple js arrayarray elementarray result object in javascriptjava araysget assigned parameters of matrices javajs get array valuesjs get elements and store them into arrayjava array with indexdefine arraylist of all things we can do with arrays in javawhat is array organisationhow to get arraayreturn new array javascripthow to build data array in javascriptwhat are arrayswhat is an arraysarray 5bi 5d 5bj 5dwhich number can be placed in an array in java for non available valuesarray of object jsarrays 27access array objects javascript 3f arrayscreate new arrayarray array 5b 2c 5d arrayjs array in arrayarray 28 22 22 2c 22 22 29what is arrayarray w3 25 arrayarray creation statementwhat are the arrays how to create a function with arrays in javascriptarraylist javascriptstring array for operators 5b 27 27 5d arrayjavascript declare array objectarrays 5b 5d 2b 5b 5d in jsjavascript ca i assign array to property arrays