I'm trying to teach myself Java, but I'm having trouble finding a decent book/tutorial to learn from. I have "Learn Java in 21 Days" and "Java for Dummies." I've started reading those and gave up a few chapters in and now I am working through the tutorials at oracle.com. None of these seem to explain things the way I think. These tutorials try to explain things in a way that I can't relate to the actual programming (like a bicycle?... can't you just use an actual computer example?). Specifically, I am looking for a tutorial that will give me a simple code, explain each line, code, variable, etc... and then add in more and more complicated coding as it goes on. I learned HTML on my own 15 years ago and then had 1/2 a class of programming with C in college and both came very easy to me, so I don't think I'm trying to take on too much by trying to teach myself Java, but let me know if I'm wrong. Anyway, does anyone know any tutorials that are like the one I described?
I'm not sure that you are going to find what you want. Java is rather more complicated than HTML and I don't think it's appropriate to teach object-oriented programming in a bottom-up fashion. You need to grasp the concept of classes before going too deeply into the details.
The books that you are using are excellent. Stick with them and the whole idea of OO programming will suddenly click.
Thanks ijack. I understand the concept behind classes, but I know there are things I am missing. For example, one exercise has me write a program that sets a = 2 and b = 3 and then c = a + b and then print out c. If I didn't understand that later I could have a and b set to user input and then print a different value for c each time, I would wonder what the point is of programming all this instead of just printing c = 5. This is very simple, but I know there are other ideas like this that I know I am missing. I'm sticking with it, but I am just getting frustrated with trying to understand something that doesn't have any meaning until later. I guess my problem is I need the details to properly understand the concepts. Thanks for the info tho.
Introduction to Java Programming by J. Liang is a great book. I used it for a class and it teaches the way you said: introducing simple concepts and building on them. It covers everything from simple variable decleration all the way to threading and GUI work (if you decide to go that far). They have a lot of simple exercises at the end of each chapter and being a very popular university text, there are plenty of discussions found on various forums if you ever get stuck (just do a google search with the first sentence of the problem). Hope this helps
I usually recommend a higher level language as a first language, but since you are already up in it, the best thing to do is to not rush it or over think things in the beginning. Yes you will need some examples that don't mean a whole lot at first, but you are building a foundation for more complicated stuff later.
You may want to check out the devshed forums if you get stuck at some point. There is a sub-forum devoted to Java. I would stress to yourself the objects first, and learn the functional stuff as you need it.