tags:

views:

854

answers:

15
+7  Q: 

Learning Java?

Hello, I'm looking to learn Java in the next few weeks and was wondering on a good book to buy. I have little programming experience. I'm looking for something that can give me lots of examples, and at the same time explain concepts well.

So I'll throw it out there to the experts, what is the best book to learn java?

Thanks in advance.

A: 

I found Core Java by Cay S. Horstmann and Gary Cornell to be very readable.

David Dibben
+2  A: 

I don't have a sepcific book to recommend but I've always had a lot of luck with the O'Reilly series.

I've always found thier books to be to the point and full of really good examples. I've learned many things from thier books.

But I do want to mention that I've never read their Java book, I mostly read the Microsoft Technology books.

Amazon: Learning Java

Frank V
+9  A: 

I personally found Sun's official Java Tutorial to be a great way to learn the language. As a bonus, the online version is free.

Mr Fooz
+3  A: 

I liked Thinking in Java when I was learning:

Steve B.
I'm a c# dev now, but back in the 90's Bruce's book was essential even if you didn't develop in Java.
Kev
good book on theory, did not know there was version that new out.
WolfmanDragon
+11  A: 

The Head First series are a good introduction for a complete novice. It will get you though the basics.

Your Brain on Java

John Daly
+1 This is a good book to start out with as it gives a solid foundation of the basics without being intimidating or overwhelming.
Jonathan S.
and it's good fun as well
JohnIdol
A: 

As a complete novice I would recommend at least taking 1 programming course to just cover the basics of programming concepts. I'm talking about fundamental stuff like iteration and conditionals. One of the first programming books I remember using in class were from Deitel. They are rather cookbook like sometimes. but I think that helps as a beginner. If that's not what you are looking for I would go with the java tutorials. Also once you learn how to use the java online documentation things get a lot easier.

Kinze
+2  A: 

I will second the vote for the online Java Tutorial. In addition to being (a) free, it also has (b) downloadable code for every example, and (c) hyperlinks directly to the official documentation of every language and library feature that it uses.

The hardest part of getting started being a programmer these days is probably not finding the right book. I would recommend an intro class or a knowledgeable friend to get you set up with a useable programming setup on your computer. Knowing that you have the ability to run a program that you wrote, conveniently and quickly whenever you want, is key to being able to try out your ideas and learn from them.

jonrock
+2  A: 
VonC
A: 

I agree with Steve B Thinking In Java by Bruce Eckel is essential reading. I still go back and thumb through my 1st edition from 1998 and get all nostalgic.

Kev
A: 

I really hate their title, but "Java For Dummies" is actually a pretty good introduction to the language. I'm an experienced C/Python/PHP developer so I skimmed alot of the parts that looked like C and picked up on the Java specific stuff quickly.

Brian C. Lane
+2  A: 

Thinking in Java is probably the best book I've ever read about Java.

I also suggest Head First Java, from O'Reilly. It is written for learning quickly the foundations and the best practices of the language. If you have little programming experience, I think this one can be the best choice. The are a lot of examples and exercises and a very nice sample application that you can build while reading the book. When you arrive at the end of the book, you will have very good foundations on Java.

alexmeia
probably the best books to sart with, even though the tutorial option as mentionned in other answers is also valuable.
Gilles
A: 

I myself have used the Blue Pelican Java text book and found it to be very good. Its free and comes in a nice PDF file. The only downfall is that you can not buy and answer book unless you are a teacher.

+2  A: 

IMO, the best way to learn java, is actually to mooch free lecture slides from Universities, and attempt their assignments.

While this barely teaches you the strength of Java, it'll quickly teach you the basics, and some of the finese` of java.

Lect notes get you started easily, and their assignments are made to make you think, and if you're lucky you can mooch free access to their forums where people ask questions if they get stuck. Chances are, a body of students will encounter at least some of the same issues you have.

Problem; you learn like a student, 'close enough is good enough.'

Once you've mastered the basics, use the $ saved to buy actual books on real uses for java, (J2EE best practices, Java Web Dev, SOA, etc).

(Learning the finer points later will hopefully help you take up best practices etc, and learn to be code in a more ... civil way.)

Alex Lim
A: 

You need a book of examples to go along with the theory of the code.The Java Cookbook is full of working code examples to demonstrate and to use in production code. Good for beginner and intermediate alike.

WolfmanDragon
A: 

Complete Refernce Java 2

Harsha M V