Arrays fill with multidimensional array in Java

0 votes

Without using a loop, how can I fill a multidimensional array in Java? I tried:

double[][] arr = new double[20][4];
Arrays.fill(arr, 0);

The outcome is java.lang. ArrayStoreException: Double in Java

Nov 16, 2022 in Java by Ashwini
• 5,430 points
609 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
1 answer

Join array elements with a separator in Java

Using Java 8, you can easily perform ...READ MORE

answered Aug 16, 2018 in Java by geek.erkami
• 2,680 points
2,789 views
0 votes
0 answers

How do I fill arrays in Java?

Is there a proper way to fill ...READ MORE

Aug 12, 2022 in Java by krishna
• 2,820 points
572 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 81,222 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,220 points
3,578 views
0 votes
2 answers

How to create a 2-D array in java?

int[][] multi = new int[5][]; multi[0] = new ...READ MORE

answered Jul 16, 2018 in Java by Daisy
• 8,140 points
1,543 views
0 votes
1 answer

How to print java array in the simplest way?

String[] arr = new String[] {"John", "Mary", ...READ MORE

answered Apr 17, 2018 in Java by sophia
• 1,400 points
840 views
0 votes
0 answers

Matrix multiplication using arrays

Utilizing multidimensional arrays, I'm attempting to create ...READ MORE

Aug 5, 2022 in Java by krishna
• 2,820 points
627 views
0 votes
0 answers

Multidimensional Arrays lengths in Java

How can I determine the lengths of ...READ MORE

Aug 8, 2022 in Java by krishna
• 2,820 points
427 views
0 votes
2 answers

How an object array can be converted to string array in java?

System.arraycopy is the most efficient way, but ...READ MORE

answered Aug 8, 2018 in Java by Sushmita
• 6,920 points
5,656 views
0 votes
2 answers

How does random shuffling of an array

Here is a simple way using an ArrayList: List<Integer> ...READ MORE

answered Nov 2, 2018 in Java by Sushmita
• 6,920 points
909 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP