Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I don\'t know why my code doesn\'t compile! public class IAM { public static voi

ID: 3766526 • Letter: I

Question

I don't know why my code doesn't compile!

public class IAM
{
public static void print(int[] a)
{
for( int i=0; i<a.length; i++)
{
System.out.print(a[i] +"");
}
System.out.println();

public static rotateDown(int[] a)
{
int temp = a[a.length-1];
for (int i=a.length-2; i>=0; i--)
{
   a[i]-1 = a[i];
}
   a[0]=temp;
}
public static int search (int[] a, int n)
{
   int rv = -1;
   int i = 0;
   boolean found = false;
  
  
   while ( i<a.length && !found)
   {
if (a[i] == n)
{
   found = true;
   rv = i;
}
i++;
   }
   return rv;
}
   }
}

Explanation / Answer

your programme syntax is correct in java but you are run in cpp so that cant complie

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote