Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Depot
- {
- }
- private final HashMap<Integer, Depot> depots;
- depots = new HashMap<>();
- public Depot[] getDepots()
- {
- if (depots.values().isEmpty())
- {
- return (Depot[]) new Object[0]; ***
- }
- else
- {
- return depots.values().toArray(new Depot[depots.values().size()-1]);
- }
- }
- public Depot[] getDepots()
- {
- if (depots.isEmpty())
- {
- return new Depot[0];
- }
- else
- {
- return depots.values().toArray(new Depot[depots.size()]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement