Good Java Books for Beginners? 13
nobody69 asks: "During the spring I took a C++ class at the local junior college and, frankly, the textbook sucked. However, I remembered hearing Good Things about 'Practical C++ Programming' on /., so I picked it up and found it to be a great resource, especially since it was about half the price of the text. But I'm starting Java soon, so I was wondering if there was any Java equivalent - something with lots of short, to-the-point examples and good explanations. 'Practical C++ Programming' also had some exercises at the end of each chapter, whicch would be nice, but aren't necessary."
ORA to the rescue (Score:3)
I really liked the previous editions of O'Reilly's Java in a Nutshell [oreilly.com] and Java Examples in a Nutshell [oreilly.com]. My job doesn't involve Java (thank the gods! :), so I haven't had much use for them, but still they sit on my bookshelf, and my co-workers that do program in Java have either borrowed both of them repeatedly or have copies of their own. (The same author, David Flanagan, is also the author of a couple of O'Reilly's JavaScript books, but that's not what you're looking for here.)
(Ok sorry I can't resist -- my favorite lame Java bashing line: "Java has all the graceful simplicity of a systems language like C with the incredible performance of a scripting language like Python. That is to say, it's ugly as hell & slow as shit." Personally, I say if you're better off going with ugly but fast, like C, or pretty but slow, like Python. Java is the worst of all worlds, remarkable mainly for the dexterity with which Sun's marketing department has shoved this terrible language down our collective throats.)
But, like I say, I'm trying to be constructive here :). Less sarcastically, the Nutshell books are great, both as a learning tool and as a refernce later, after you're comfortable with the language. The same applies with other books in the series too.
What I did (Score:4)
However, Java is a different deal all together. First of all, if you are familiar with C++ you now about 90% of Java right of the bat. So you don't really need a "from scratch" Java book. All you really need is reference material, and some basic guides on how key things work in the JVM, like threading, synchronization, etc.
My recommendation is the web on this one. Download the latest JDK (1.3 or 1.4). That is full of great references, API's, HOWTO's and guides. This will be the source of 95% of your Java knowledge.
Next, I'd start checking out C/C++ User's Journal's Java Solutions [cuj.com]. You can subscribe to the magazine, but frankly I'd stick to the online version. These guys are C++ freaks who talk about java from the C++ perspective, so you will feel at home with the discussions there.
The only books that I would recommend, are for specific applications. For GUI work, get O'Reilly's Java Swing, and Topley's Core Swing Advanced Programming. Either one will do; they are both excellent. For Serlvet's, O'Reilly's Java Servlets is OK, but slightly out of date (maybe mine is and they have updated). Also, Professional JSP by Wrox is excellent for both serlvet and JSP work (even touches on EJB).
What is interesting for me about Java, is that I find myself using online resources much more than I ever do with C/C++ applications. Java documentation is so standardized (javadoc) that it lends well to this approach.
Decent Java books (Score:2)
Bruce Eckel's Thinking in Java is a great book for introducing C/C++ programmers to Java, and some of the coverage is excellent. However, some of what Eckel says is just plain wrong, particularly his coverage of Servlets. But that's okay, since you'll want subject/API-specific books by the time you get to those areas anyway.
Good servlet/JSP coverage is quickly had from the Wrox books: Professional JSP 2nd ed., Professional Java Server Programming J2EE ed., etc. Also, staples like Jason Hunter's Java Servlet Programming and Hans Bergsten's JavaServer Pages from O'Reilly are quite good, though less bang (ie, pages) for the buck.
Java in a Nutshell is an essential reference, but a really sucky introductory tutorial.
The best JDBC book I know of is the JDBC API Tutorial and Reference, 2nd ed. Avoid O'Reilly's JDBC book, it just isn't anywhere near as good, and the examples don't make much sense.
I've heard good things about Java IO and Java Networking by Elliott Rusty Harold from O'Reilly, but I've not had the chance to pick them up. Brett McLaughlin's Java and XML is good, but wait for the next edition.
If you are (or become) serious about Java (or any other OO language), you would do yourself a HUGE favor to pick up the Gang of Four's Design Patterns.
---Good luck!
Java (Score:1)
Depends on what kind of learner you are (Score:1)
As someone who has already learnt C you should already know about data stuctures and all the computer science basics, so a vast reference book would like the Dietel and Deitel would probably suit you better than books like Java Gently which are more about teaching you how to program.
Dont buy a "For Dummies" book borrow it from the library and copy any code/toy programmes that interest you but i really think they are a waste of money.
You should of course check out the resources provided by Sun ( http://java.sun.com/ )
Definately give the turorial a look
http://java.sun.com/docs/books/tutorial/index.h
java programming would be a lot harder without having the full API close to hand
http://java.sun.com/j2se/1.3/docs/api/index.htm
best of luck
and remember writing portable, well documented, well structured reusable code is not a bad thing.
I found these useful (Score:2)
Re:I found these useful (Score:1)
Learning Java (Score:1)
I just bought Learning Java from O'Reilly. Really good book, lots of good examples, I am very happy with it so far.
The only minor fault is that some things where you might want to branch into a specialised topic it covers very lightly and then recommends another O'Reilly book for that topic. I guess that is OK though, because it does cover a lot of stuff.
No easy answer (Score:2)
There is no single book that is going to do it for everyone, and not all people learn the same way. You might as well spend the time reading over the first few chapters of several books, and figure out which writers you retain information with, which ones present ideas in ways that you can understand them, and which ones were put out by companies looking to expand their booklists. Also, you might as well get used to the idea that you'll probably want two books (at least), one which is a beginner's book and a second which will probably act as a complete reference. Their roles will be different -- one's purpose will be to get your feet wet and the other's will be for speedy knowledge lookup once you know what you're doing. Chances are, depending on what type of programming you want to get into, you might need a third Java reference specifically for that topic (ie: servlets, database aps, etc.).
Stay away from For Dummies books. I picked up one that had typos in the code listings that no "Dummy" would have been able to figure out (like, forgetting to pass an argument by its address -- that's C++ related but you get my drift, hopefully).
I'm personally very wary of books that attempt to be both beginner's books AND complete references (Deitel and Deitel in particular put me on edge -- they try to do both and come up short in both, they tend to be too involved for beginner's level and too jumbled and disorganized to be decent reference books, imo).
I think multiple texts with multiple points of view are really good for putting a language into perspective. Besides, you'll also get exposed to different coding styles and techniques, which will be useful in the long run. For this reason, don't discount online references. They probably aren't the greatest primary material, but the more examples you're exposed to, the better.
Mastering Java 2 (Score:2)
Despite its bad reviews on Amazon, Mastering Java 2 [amazon.com] is an excellent resource for beginner to export.
It starts assuming you are familiar with programming concepts, but not with Java, and covers the bases from there. The first 8 chapters or so are dedicated to the groundwork: Java syntax, objects, concepts, all the way through to threading. There is extensive coverage of the AWT and (IIRC) Swing, and a good rundown on IO streams later in the book. It also introduces RMI, CORBA and other technologies enough to impart some understanding so you can get going on your own or with 'net references.
Re:Fan of Thinking In Java (Score:1)
I can also recomend this book. I bought the first edition when i started learning java and find the book very good.
It is very easy to read and goes very deep without getting complicated. I still read it from time to time and i have bought the second edition now wich has an excellent chapter on the Collection interfaces.
Re:Java (Score:1)
Fan of Thinking In Java (Score:1)