Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static final List<Double> prices = new ArrayList<>();
- public static void main(String... args){
- prices.add(3d);
- getPrice(1);
- }
- public static Double getPrice(int i)
- {
- return (i >= prices.size()) ? Double.NEGATIVE_INFINITY : prices.get(i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement