Java List Last Item getLast(List list)

Here you can find the source of getLast(List list)

Description

get Last

License

Apache License

Declaration

public static <T> T getLast(List<T> list) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static <T> T getLast(List<T> list) {
        return list.get(lastIndex(list.size()));
    }/*  w  ww .  j a v  a  2s.  com*/

    public static int lastIndex(int size) {
        return size - 1;
    }
}

Related

  1. getLast(List list)
  2. getLast(List list)
  3. getLast(List list)
  4. getLast(List list)
  5. getLast(List list)
  6. getLast(List list)
  7. getLast(List source)
  8. getLast(List list)
  9. getLastBefore(List list)