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

3

u/[deleted] Feb 27 '22

Start by writing the code given in the book examples, and then keep on adding the topics you've learnt. For example, start with the File I/O example, add some exception handling, add some GUI code using Swing or JavaFX, make some modular classes for handling different types of files, create a hierarchical type using abstract classes, interfaces. Try to use functional interfaces, write some methods that use Stream API and /or lambda expressions. Do all of this, without using the main() method, you're only allowed to call 1-3 methods in the main.