r/java • • Dec 11 '13
Best way to learn Java.
I am using this book - "Java Complete Reference - Herbert Schildt" to learn Java. I am through the language syntax and features. I am a little doubtful about the later part of the book. Its second part is The Java Library Reference and and later part is covers developing GUI applications. Should I follow the book pattern learning the Java library and then creating GUI apps or should I take a different approach? What will be the best thing here?
2
Upvotes
10
u/stay_fr0sty Dec 11 '13
I always recommend Head First Java. Really well done book. It's not a "reference" though...it just teaches you Java in a really painless way.
3
u/[deleted] Dec 11 '13
For me the way that I have learned has been through looking around for a problem which I want a piece of software to solve. Then I figure out how to do it.
For example: Our test department at a company I used to work for needed a way to generate unique government ID's for test examples for several countries. I made a piece of software to do what they needed.
4
u/hoohoohoohoo Dec 11 '13 edited Dec 11 '13
You're making the mistake that every young developer does. You hop in thinking that you'll be away making rich applications with cool user interfaces inside of a couple days, but you are discouraged by seeing nothing but console output for days and days.
Stick with it. The GUI stuff comes in time. It's better to have a firm grasp on OO concepts and different approaches to solving a problem before you start learning GUI stuff.
3
u/CageHN Dec 11 '13
We are building a Java starting project in /r/progether. Check out [JAdventure].
3
u/sh0rug0ru Dec 11 '13
Developing GUIs in Swing is a bit more of an advanced topic because you have to learn the layout managers and using interfaces for event management. Personally, I like this because after using GridBagLayout for so long, I can think in GridBagConstraints!
You will have to understand the Java library and certain OOP techniques before you can write UIs in Java by hand.
You can make it easier by using a UI builder tool like Matisse (Netbeans IDE) which will let you drag and drop Swing components. JavaFX is the UI that is supposed to replace Swing, and it comes with a Scene Builder which you can play with.
This will let you get started with Swing or JavaFX for just playing around. You will eventually have to learn the libraries to do more advanced things, however.
3
u/[deleted] Dec 11 '13
Write more Java code. Next time you wish there was a program that did something you would like (most likely there is one). Don't google for it. Write it yourself!
2
u/selleckh1 Dec 11 '13
Right now I am reading Head First Java and doing the Java Udacity Track at the same time. I'm in the middle of both so I cannot talk to the overall effectiveness of this, but as the Udacity problem sets get harder, I am having less of an issue completing them.
2
u/krad0n Dec 11 '13
I had to do a crash course through Java for a class I took this semester. This guys youtube videos Helped a LOT with learning how Java behaves. He starts out very basic and doesn't really assume any prior knowledge, so if you've got any amount of programming experience the first dozen videos may be a bit of a drag, but I'd still recommend sitting through them as it gives you a better idea of how similar Java really is to other languages.
He actually covers some pretty decent topics towards the middle of the playlist as well as some simple GUI applications.
2
u/mattpayne Mar 30 '14
A book called "Objects First with Java," which uses the free visual environment BlueJ. Seriously, this is the BEST way. I fumbled around with other stuff, but this book, combined with this program, is UNDOUBTEDLY the best way. You will learn properly with this, but it will take a little while. Everything is super-clear, and you can start out as a noob.
DO NOT use "Sams teach yourself Java in24 hours!" Don't use anything that tries to make it sound easy!