+ 1

Java Excercises?

I am currently progressing through the Java course and found the first 3 sections fairly easy to learn and remember. I am currently working through the 4th "Classes" section and I am starting to find that it's getting heavy. I think a lot more repetition is needed for each of the new concepts for me to be able to remember them. I see there is a challenges section but I suspect you need to complete the course before attempting this as some of the code is beyond what I have learned so far. Excersises wld help

10th Nov 2017, 3:27 PM
David Wyness
David Wyness - avatar
3 ответов
+ 3
Open up the Code Playground and just start programming stuff. Best way to understand classes is to play with it so you can see how it works. I'll write up an example and post it here for you in a moment. For me it has helped to simply think about classes as blueprints that you use to create objects in the world. Just like in the "real" world, we have blueprints that map out what we're building, provides its defaults, provides the methods we'll use on it and what stuff the object itself will be capable of doing once in the world. Then we use that blueprint (class) to create (instantiate) objects from it that we'll use in the world (program). We can create as many of the objects as we want, and each of the individual objects will not affect each other or the original blueprint, so you can manipulate each of the individual objects as needed without having to worry about it impacting the other ones. (worth noting there are means of changing the blueprint/etc..., but for analogy purposes, just bare with me. lol) When I think about it like that, it becomes a lot easier for me to understand the various aspects of it, why, and how it operates. As simple as it sounds, think of it as actual objects.
10th Nov 2017, 3:55 PM
AgentSmith
+ 1
Thanks for your answer. That's a good tip about having a play with the code and that's kind of what I am looking for. I think a set of Excercises would be useful for each section. As a very simple example for the very early lesson the excercise might be to just write code that prints hello world to the screen. Obviously this is fairly easy in this example but as the course goes on there is more to remember and repetition would really help. Let's say after the constructors lesson there was a range of excercises that said write code to achieve xyz. Doing a number of these would really help to commit what was learned to memory. I just wondered if Sololearn had this feature. Sololearn is great and even better that it's free, I just think a feature as described would be a great improvement. :)
10th Nov 2017, 4:06 PM
David Wyness
David Wyness - avatar
0
Every 'try it yourself' do so. Look at the code and figure it out. Modify it to see what happens. If you end up with problems, save it so you can post here for help.
10th Nov 2017, 5:54 PM
John Wells
John Wells - avatar