Java Deque Usage getLast(List list)

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

Description

get Last

License

Apache License

Declaration

@SuppressWarnings("unchecked")
    public static <T> T getLast(List<T> list) 

Method Source Code


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

import java.util.Deque;
import java.util.List;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> T getLast(List<T> list) {
        if (list instanceof Deque) {
            return ((Deque<T>) list).getLast();
        }//from ww  w .  java2s . c o  m
        return list.get(list.size() - 1);
    }
}

Related

  1. addSegment(Deque outputBuffer, String nextSegment)
  2. buildQueryString(final Map> params)
  3. createEmptyDequeArray(int size)
  4. emptyDeque()
  5. getArrayDeque()
  6. pop(Deque deque, T def)
  7. removeLastTest(Deque q)
  8. splitWords(String text)

  9. HOME | Copyright © www.java2s.com 2016