Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. private static final List<Double> prices = new ArrayList<>();
  2. public static void main(String... args){
  3. prices.add(3d);
  4. getPrice(1);
  5. }
  6. public static Double getPrice(int i)
  7. {
  8. return (i >= prices.size()) ? Double.NEGATIVE_INFINITY : prices.get(i);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement