Skip to content

Java Derusting#12

Open
f3liz wants to merge 8 commits intoauberonedu:mainfrom
f3liz:main
Open

Java Derusting#12
f3liz wants to merge 8 commits intoauberonedu:mainfrom
f3liz:main

Conversation

@f3liz
Copy link
Copy Markdown

@f3liz f3liz commented Jan 6, 2025

completed java files and added to toRefresh.md

Copy link
Copy Markdown
Owner

@auberonedu auberonedu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! See comments below

Comment thread src/ListPractice.java Outdated
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<>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to use interface types when you don't need to concrete implementation specified:

List<String> newList = new ArrayList<>();

Comment thread src/MapPractice.java Outdated
// Create a HashMap with String keys and Integer values and
// assign it to a variable of type Map

HashMap<String, Integer> map = new HashMap<>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to use interface types when you don't need to concrete implementation specified (Map)

Comment thread src/Person.java Outdated
Comment on lines +39 to +41
public int birthYear () {
return 2025 - age;
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/SetPractice.java Outdated
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<>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to use interface types when you don't need to concrete implementation specified (Set)

Comment thread src/StringPractice.java Outdated
System.out.println();
// Create an ArrayList of Strings and assign it to a variable

ArrayList<String> list = new ArrayList<>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to use interface types when you don't need to concrete implementation specified (List)

@f3liz
Copy link
Copy Markdown
Author

f3liz commented Jan 6, 2025

Thank you for the feedback Auberon. I went back and corrected it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants