r/learnjava • • Feb 27 '22

How can I practice Java Generics, Collections Framework, File I/O, Streams and Multithreading

I'm currently reading Java Complete Reference and have been trying it's Example Codes but I'm not getting how can I use them in real world Programming or how can I practice above mentioned topics.

Are there any online resources or assignments that could help me to work more on these topics. I've tried using Online Coding Sites but I'm still finding it hard that how can I leverage these while writing Java Code.

42 Upvotes

9 comments sorted by

View all comments

10

u/MRH2 Feb 27 '22

File I/O:

  • Read in a book from Project Gutenberg (either by downloading it and then reading it in, or reading it directly from the URL)

  • find out how many of each letter there are, print out the top 5 most common letters.

  • Now do it with words (you'll need a hashmap). Find the 5 most common words (ignore a, an, the). And you'll have to handle punctuation, so that "Hooray!" is seen as the same word as hooray .

  • Now rewrite it using streams.