Advertisement
cd62131

Print Dictionary Last Element

Dec 7th, 2013
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.27 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.TreeSet;
  3. public class DinctionaryOutput {
  4.   public static void main(String[] args) {
  5.     String[] fruits = { "grape", "orange", "apple", "kiwi" };
  6.     System.out.println(new TreeSet<String>(Arrays.asList(fruits)).last());
  7.   }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement