Conversation
auberonedu
left a comment
There was a problem hiding this comment.
Nice job! See comments below
| public static void main(String[] args) { | ||
| // Create an empty ArrayList of Strings and assign it to a variable of type List | ||
|
|
||
| ArrayList<String> newList = new ArrayList<>(); |
There was a problem hiding this comment.
Remember to use interface types when you don't need to concrete implementation specified:
List<String> newList = new ArrayList<>();
| // Create a HashMap with String keys and Integer values and | ||
| // assign it to a variable of type Map | ||
|
|
||
| HashMap<String, Integer> map = new HashMap<>(); |
There was a problem hiding this comment.
Remember to use interface types when you don't need to concrete implementation specified (Map)
| public int birthYear () { | ||
| return 2025 - age; | ||
| } |
There was a problem hiding this comment.
This doesn't quite match the Javadoc. Note the @param which specifies that the current year should be passed in instead of being hardcoded at 2025.
| public static void main(String[] args) { | ||
| // Create a HashSet of Strings and assign it to a variable of type Set | ||
|
|
||
| HashSet<String> set = new HashSet<>(); |
There was a problem hiding this comment.
Remember to use interface types when you don't need to concrete implementation specified (Set)
| System.out.println(); | ||
| // Create an ArrayList of Strings and assign it to a variable | ||
|
|
||
| ArrayList<String> list = new ArrayList<>(); |
There was a problem hiding this comment.
Remember to use interface types when you don't need to concrete implementation specified (List)
|
Thank you for the feedback Auberon. I went back and corrected it. |
completed java files and added to toRefresh.md