Skip to content

Finished all Practice Problems.#13

Open
tgillysuit wants to merge 2 commits intoauberonedu:mainfrom
tgillysuit:main
Open

Finished all Practice Problems.#13
tgillysuit wants to merge 2 commits intoauberonedu:mainfrom
tgillysuit:main

Conversation

@tgillysuit
Copy link
Copy Markdown

We should do more of these every week!

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! Maybe we will do more 🙂

Comment thread src/ListPractice.java

public static void main(String[] args) {
// Create an empty ArrayList of Strings and assign it to a variable of type List
ArrayList<String> List = new ArrayList<String>();
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
// Create a HashMap with String keys and Integer values and
// assign it to a variable of type Map

HashMap<String, Integer> map = new HashMap<String, Integer>();
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 (Map)

Comment thread src/StringPractice.java
};

// Create an ArrayList of Strings and assign it to a variable
ArrayList<String> list = new ArrayList<String>();
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 (List)

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