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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.