Question: What is the error in the given code? public class progArray { public static void main(String[] args) { double] m1 = new double[4.5]; double

What is the error in the given code? public class progArray { 

What is the error in the given code? public class progArray { public static void main(String[] args) { double] m1 = new double[4.5]; double pgno = new int[]{2,3,4,5); m1= new double {2.1,2.5,3.9,4.2}; System.out.println(m1[1]); System.out.println(pgno[1]); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

There are several errors in the given code Here is a corrected version java public class ProgArray p... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!