how to fix my for code in java, not working : <p>Program that accepts integers and stores them in an array, and outputs the largest number of them.
but following code is not working</p>

<p>import java.util.Scanner;</p>

<p>public class Test2 {</p>

<pre><code>public static void main(String[] args){
    System.out.print("input the array'size : ");
Scanner sc = new Scanner(System.in);
int size = sc.nextInt();
int arr[]=new int[size];


System.out.print("input the array'value :");
for(int i=0; i&lt;size; i++){
    int var = sc.nextInt();
    arr[i] = var; 
}

System.out.print("inputed value: ");
for(int i=0; i&lt;size; i++) {
System.out.print(arr[i]+ " ");
}

int max = 0;
for(int j=0; j&lt;size; j++){
    if(max&lt;arr[j+1]){
    max = arr[j];   
    }
    else {
    continue;
    }
}
System.out.println("the largest number in array :"+ max);
}
</code></pre>

<p>}</p>
