I want to check if the last numbers in an arraylist are a 10.My data is in a 2d arraylist with 110 elements every 10 numbers is one node, I want to verify that the last digit of each node is a 10.

example: 1,2,3,4,5,6,7,8,9,10 in this case its true 1,12,3,4,8,5,4,8,9,8 in this case its false

        public static void main(String[]args){
           ArrayList<ArrayList<Double> > array= new ArrayList<ArrayList<Double> >();
            for (int i = 0; i < array.size(); i++){
                if(logic here){
                    System.out.println(not 10.0);
                }else{
                    system.out.pritnln(10.0);
                }
            }
        }

how can I implement the correct logic for this case? Thank you!!!

Hint (also applies to your other thread):

You can get the nth element in a List as follows: list.get(n)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.