So this is a tool I have been using some time. You remember the days when you just hated any school project? Well Hackerrank is like a school project. The goal, the requirements and the restrictions are given and off you go. There is even a test at the end, or in most cases multiple tests. This way you are encouraged to write so generic code as possible. In my opinion this is the best way to quickly gain code experience. Student-me would have called me crazy. Work-me likes to learn new and better ways to code. Not just my beloved Java, but scala, ruby, ... The website provides multiple disciplines and languages to practice.
I have tried multiple of those 'learning-websites' where you cna practice your coding skills, Hackerrank is my personal favourite. It is straight forward, still feels like coding and has different skill levels.