Question 3. Find and correct the error(s) in each of the following code fragments :
1-The following code should create an integer array and increment all the array elements by 1:
int[] a = new int[5]; for( int i=0; i <= a.length; i++ ) ++a;
2-The following code should compare two integers to determine if they are not equal:
int x = 9, int y = 3; System.out.print( "x != y " + x != y );
1
Expert's answer
2020-04-05T16:24:25-0400
Dear Lavi, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Comments
Leave a comment