Java calculate the sum of the given numbers

This program calculates the sum from 10 numbers, you could hit “stop” to break and calculate less than 10 numbers:

public class HelloWorld{
     public static void main(String []args){
        int[] values = new int[10];
        int i = 0;
        int sum = 0;
        System.out.print("write up to 10 numbers !\n");//Info text
        for(i = 0; i <= values.length-1;++i){
           System.out.print("write your number: ");//Info text
           String str = System.console().readLine();
           if(!str.equals("stop")){
           values[i] = Integer.parseInt(str);//read input
           }else{--i;break;}
        }
        System.out.print("your input:\n");//Info text
        for(int x = 0; x <= i;++x){
           System.out.print("your number: "+values[x]+"\n");//Info text
           sum += values[x];
        }
        System.out.println("your result: "+sum);//print result
     }
}

Output looks like this:

write up to 10 numbers !
write your number: 1 
write your number: 2 
write your number: 3 
write your number: stop 
your input:        
your number: 1 
your number: 2 
your number: 3 
your result: 6