Head First Java and over 2 million other books are available for Amazon Kindle . Learn more

Buy New

Sign in to turn on 1-Click ordering.
Buy Used
Used - Good See details
Price: 16.97

Trade in Yours
For a 8.25 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Image not available

Start reading Head First Java on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Head First Java [Paperback]

Kathy Sierra , Bert Bates
4.2 out of 5 stars  See all reviews (71 customer reviews)
RRP: 28.99
Price: 20.29 & FREE Delivery in the UK. Details
You Save: 8.70 (30%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In stock.
Dispatched from and sold by Amazon. Gift-wrap available.


Amazon Price New from Used from
Kindle Edition 14.52  
Paperback 20.29  
Trade In this Item for up to 8.25
Trade in Head First Java for an Amazon Gift Card of up to 8.25, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Learn more

Book Description

19 Feb 2005 0596009208 978-0596009205 2

Learning a complex new language is no easy task especially when it s an object-oriented computer programming language like Java. You might think the problem is your brain. It seems to have a mind of its own, a mind that doesn't always want to take in the dry, technical stuff you're forced to study.

The fact is your brain craves novelty. It's constantly searching, scanning, waiting for something unusual to happen. After all, that's the way it was built to help you stay alive. It takes all the routine, ordinary, dull stuff and filters it to the background so it won't interfere with your brain's real work--recording things that matter. How does your brain know what matters? It's like the creators of the Head First approach say, suppose you're out for a hike and a tiger jumps in front of you, what happens in your brain? Neurons fire. Emotions crank up. Chemicals surge.

That's how your brain knows.

And that's how your brain will learn Java. Head First Java combines puzzles, strong visuals, mysteries, and soul-searching interviews with famous Java objects to engage you in many different ways. It's fast, it's fun, and it's effective. And, despite its playful appearance, Head First Java is serious stuff: a complete introduction to object-oriented programming and Java. You'll learn everything from the fundamentals to advanced topics, including threads, network sockets, and distributed programming with RMI. And the new. second edition focuses on Java 5.0, the latest version of the Java language and development platform. Because Java 5.0 is a major update to the platform, with deep, code-level changes, even more careful study and implementation is required. So learning the Head First way is more important than ever.

If you've read a Head First book, you know what to expect--a visually rich format designed for the way your brain works. If you haven't, you're in for a treat. You'll see why people say it's unlike any other Java book you've ever read.

By exploiting how your brain works, Head First Java compresses the time it takes to learn and retain--complex information. Its unique approach not only shows you what you need to know about Java syntax, it teaches you to think like a Java programmer. If you want to be bored, buy some other book. But if you want to understand Java, this book's for you.

Frequently Bought Together

Head First Java + Head First Design Patterns + Head First Object-Oriented Analysis and Design: A Brain Friendly Guide to OOA&D
Price For All Three: 80.07

Buy the selected items together

Product details

  • Paperback: 720 pages
  • Publisher: O'Reilly Media; 2 edition (19 Feb 2005)
  • Language: English
  • ISBN-10: 0596009208
  • ISBN-13: 978-0596009205
  • Product Dimensions: 23.6 x 20.3 x 3.8 cm
  • Average Customer Review: 4.2 out of 5 stars  See all reviews (71 customer reviews)
  • Amazon Bestsellers Rank: 13,755 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Authors

Discover books, learn about writers, and more.

Product Description

About the Author

Kathy Sierra has been interested in learning theory since her days as a game developer (Virgin, MGM, Amblin'). More recently, she's been a master trainer for Sun Microsystems, teaching Sun's Java instructors how to teach the latest technologies to customers, and a lead developer of several Sun certification exams. Along with her partner Bert Bates, Kathy created the Head First series. She's also the original founder of the Software Development/Jolt Productivity Award-winning javaranch.com, the largest (and friendliest) all-volunteer Java community.

Bert Bates is a 20-year software developer, a Java instructor, and a co-developer of Sun's upcoming EJB exam (Sun Certified Business Component Developer). His background features a long stint in artificial intelligence, with clients like the Weather Channel, A&E Network, Rockwell, and Timken.

Excerpt. © Reprinted by permission. All rights reserved.

Chapter 2 A Trip to Objectville

I was told there would be objects. In chapter 1, we put all of our code in the main() method. That’s not exactly object-oriented. In fact, that’s not object-oriented at all. Well, we did use a few objects, like the String arrays for the Phrase-O-Matic, but we didn’t actually develop any of our own object types. So now we’ve got to leave that procedural world behind, get the heck out of main (), and start making some objects of our own. We’ll look at what makes object-oriented (OO) development in Java so much fun. We’ll look at the difference between a class and an object. We’ll look at how objects can give you a better life (at least the programming part of your life. Not much we can do about your fashion sense). Warning: once you get to Objectville, you might never go back. Send us a postcard.

Chair Wars
(or How Objects Can Change Your Life)

Once upon a time in a software shop, two programmers were given the same spec and told to "build it". The Really Annoying Project Manager forced the two coders to compete, by promising that whoever delivers first gets one of those cool Aeron™ chairs all the Silicon Valley guys have. Larry, the procedural programmer, and Brad, the OO guy, both knew this would be a piece of cake.

Larry, sitting in his cube, thought to himself, "What are the things this program has to do? What procedures do we need? And he answered himself, "rotate and playSound." So off he went to build the procedures. After all, what is a program if not a pile of procedures?

Brad, meanwhile, kicked back at the café and thought to himself, "What are the things in this program... who are the key players?" He first thought of The Shapes. Of course, there were other objects he thought of like the User, the Sound, and the Clicking event. But he already had a library of code for those pieces, so he focused on building Shapes. Read on to see how Brad and Larry built their programs, and for the answer to your burning question, "So, who got the Aeron?

In Larry’s cube
As he had done a gazillion times before, Larry set about writing his Important Procedures. He wrote rotate and playSound in no time.

rotate(shapeNum) {
// make the shape rotate 360º
playSound(shapeNum) {
// use shapeNum to lookup which
// AIF sound to play, and play it

At Brad’s laptop at the cafe
Brad wrote a class for each of the three shapes

Larry thought he’d nailed it. He could almost feel the rolled steel of the Aeron beneath his...

But wait! There’s been a spec change.
"OK, technically you were fi rst, Larry," said the Manager, "but we have to add just one tiny thing to the program. It’ll be no problem for crack programmers like you two."

"If I had a dime for every time I’ve heard that one", thought Larry, knowing that specchange-no-problem was a fantasy. "And yet Brad looks strangely serene. What’s up with that?" Still, Larry held tight to his core belief that the OO way, while cute, was just slow. And that if you wanted to change his mind, you’d have to pry it from his cold, dead, carpal-tunnelled hands

Back in Larry’s cube
The rotate procedure would still work; the code used a lookup table to match a shapeNum to an actual shape graphic. But playSound would have to change. And what the heck is a .hif fi le?

playSound(shapeNum) {
// if the shape is not an amoeba,
// use shapeNum to lookup which
// AIF sound to play, and play it
// else
// play amoeba .hif sound

It turned out not to be such a big deal, but it still made him queasy to touch previously-tested code. Of all people, he should know that no matter what the project manager says, the spec always changes.

At Brad’s laptop at the beach
Brad smiled, sipped his margarita, and wrote one new class. Sometimes the thing he loved most about OO was that he didn’t have to touch code he’d already tested and delivered. "Flexibility, extensibility,..." he mused, reflecting on the benefits of OO

Larry snuck in just moments ahead of Brad.
(Hah! So much for that foofy OO nonsense). But the smirk on Larry’s face melted when the Really Annoying Project Manager said (with that tone of disappointment), "Oh, no, that’s not how the amoeba is supposed to rotate..."

Turns out, both programmers had written their rotate code like this:
1) determine the rectangle that surrounds the shape
2) calculate the center of that rectangle, and rotate the shape around that point.

But the amoeba shape was supposed to rotate around a point on one end, like a clock hand.

"I’m toast." thought Larry, visualizing charred Wonderbread™. "Although, hmmmm. I could just add another if/else to the rotate procedure, and then just hard-code the rotation point code for the amoeba. That probably won’t break anything." But the little voice at the back of his head said, "Big Mistake. Do you honestly think the spec won’t change again?"

Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

What Other Items Do Customers Buy After Viewing This Item?

Customer Reviews

Most Helpful Customer Reviews
67 of 70 people found the following review helpful
5.0 out of 5 stars An Excellent Tour Guide... 14 Jun 2006
To give you a bit of context so you know where I was coming from before I started reading this book, I used to be a programmer many years ago (over 15), but haven't cut any code for years other than the odd bit of VBA in Excel. I've used mainly BASIC-style languages including Informix, VB, etc. I have read about OO and tried and failed to learn C so have no real experience or understanding of what Java can do. I wanted to learn Java now a) for something to do with my brain (how I miss programming!) and b) to see what all the fuss was about.

I found the book to be very accessible - it has lots of different ways of providing the information - straight text, pictures with text on, jokes (cheesy, but ok), break-out boxes, quizzes, etc. It is probably written for people with short attention spans, but that works ok for me. Sometimes it labours a point a bit too much, but it does mean that everything sticks and I have found this book to be an excellent way for me to learn Java so far. I'm learning new stuff and it is sticking - I can leave it for a few days and still remember everything (both how AND why things are done - something the book is very good at covering). After about a week of reading (doing about an hour a night after work) I have been able to write a basic command line calculator, which uses only about 100 lines of code. I have completed this in far less time than it would have taken me to do it in Informix/VB, etc.
Read more ›
Comment | 
Was this review helpful to you?
34 of 36 people found the following review helpful
5.0 out of 5 stars Cracking book! 2 Jan 2006
I'm learning Java, moving from 8 years C++ experience. Thus much of this book covers already familiar concepts such as OO and some of the basic syntax. however rather than finding these bits dragging and skipping over them I find myself rocketing through it, hunting for the new nuggests and differences in there and enjoying the learning experience!
The style is so distinctive and effectively alternates presentation and sub-set of the chapter's subject matter on a page by page basis. Thus as the book moves into newer territory its style prevents boredom and the "frequent coffee break syndrome". I find that the non linear and slightly "hopscotch" method of changing presentation styles, fore-shadowing areas to come and going over old ground in different ways is excellent.
Overall the progress through the book is good, though i find each chapter's progress varable. The chapters are effectively the smallest area of work - you really need to complete the chapter at the end of the day (for me anyway); however leaving the exercises till the next day is good revision!
Not sure whether it's java, this book, or both but I have more of a grin programming during learning from this book than ever before! Obviously it brings out the hidden geek in me!
I would say that anyone with some programming experience would find this book excellent. those with very little or none would probably find it hard - however still the best I've seen! What this book is NOT is a reference text - it's aim, basically, is a tutorial and thus precludes it's use as reference.
Have fun!
Comment | 
Was this review helpful to you?
4 of 4 people found the following review helpful
5.0 out of 5 stars Bloody Brilliant! 12 Jan 2011
This is the first technical book I've ever bought and I was a bit unsure if I'd be able to teach myself Java without the aid of a lecturer, but as soon as I read the first few pages I was sure I'd be able to.

First of all, it's encouraging to see that new ways of teaching have emerged. The writers (and the whole team of course) know how to keep you interested using the latest studies in metacognition (thinking about thinking). It's what makes this book interesting. It's not dry. It's not boring. It's just like reading an interesting story with lots of stupid/nerdy jokes, but with the implementation of Java code always in mind.

As a reader, I came from a C++ background (beginner though) and I have to say that I could finally grasp concepts that I never really understood while studying C++. References, Stacks, Heaps: everything comes beautifully together with the writers' memorable graphs, stupid jokes etc. By reading this book, not only did I learn the Java language, but I also feel that I've learned much as a programmer in general (because every language has references, stacks, heaps etc).

A highly recommended book for anyone who wants to learn Java.

Hint: if you buy this book, you can register it at Oreilly's website and buy the book for the insignificant fee of $6. Quite useful if you have a tablet or an eBook reader etc.
Comment | 
Was this review helpful to you?
37 of 42 people found the following review helpful
2.0 out of 5 stars Made learning very frustrating 31 May 2010
By Neil
I had been learning Java for about a week before buying this book. The first book I tried was Java For Dummies but it contained no exercises and seemed to tell you about Java rather then attempt to teach you it so I decided I needed another book. I thought as this was getting so many great reviews I would try this one.

First in the introduction of this book I was very disappointed to read that that they recommend backing away from this book if you have no programming experience what so ever. Well a bit late to be telling me now! Now I already own a copy!

I felt a little bit cheated because in the amazon.com description of this book that I read before buying it says this..

"... for people with no Java experience, and even people with no programming experience at all."

I read through the customer reviews and it seems like half the reviews were saying "Not for beginners " and the others are saying "Just for beginners and not for experienced programmers."

Well this review is another one saying NOT for beginners.

If you ARE a beginner you will still learn a lot from this book. But it might make things more difficult and frustrating then they need to be.

For example the section on loops is VERY brief before it asks you to program the song "99 Bottles of Beer" using loops. Let me tell you that without any programming experience there is no way you could do this just by using the tiny bits of information the book has given you so far. It hadn't even told you that if you put the name of a variable into a print statement that it will print out the value of that variable. And their program covered several other new features that should have been introduced so you had a fair chance of figuring it out yourself.
Read more ›
Was this review helpful to you?
Would you like to see more reviews about this item?
Were these reviews helpful?   Let us know
Most Recent Customer Reviews
5.0 out of 5 stars Brilliant for learning though check out this other guy also...
easy help guide to learning java.

Strated learning java out of interest a while ago. There are many free tutorials online, one of the best is actually here... Read more
Published 6 days ago by Nimrod
World of Books Ltd is a company that is purchasing books from charity shops and library's and then re-selling them for personal profit. Read more
Published 1 month ago by Joshua Beirne
5.0 out of 5 stars Excellent book!!!
This book is absolutely brilliant for anyone new to the Java programming language. As a student myself it is invaluable to me, is extremely well-layed out, the grammar and language... Read more
Published 6 months ago by Karl Watkins
1.0 out of 5 stars Disappointing, patronising, confusing
I have been learning programming for the last few years now and I'm quite accustomed with languages such as C#, VB, JavaScript etc... Read more
Published 6 months ago by Colonel Sanders
5.0 out of 5 stars Good Read and Enjoyable Too
The book is well structured with lots of fun examples. Its novel in its approach to tackling technical jargon. Worth a read.
Published 7 months ago by Mr D Devlin
5.0 out of 5 stars i didnt like the look of the book when i got it ..BUT.......
when i got the book i didnt like the format ..i thought it was a bit childish and too many pictures......

well let me tell you.....i started learning java from it.... Read more
Published 7 months ago by eblip
4.0 out of 5 stars Wonderful!
Arrived super-fast! It is very readable and it helped a lot with my university module in programming! 4/5 because i havent finished many chapters yet :S
Published 7 months ago by Angelos Stefani
4.0 out of 5 stars It's a great book
I wanted to learn Java for making games etc... It's an amazing book for anyone who wants to get started.
Published 8 months ago by Mr. Philip Grundy
5.0 out of 5 stars Great book
Really good book to learn java, I like the way they use different approaches to explain the oddities about java
Published 10 months ago by pedro cardoso
5.0 out of 5 stars Great book for a novice programmer
Highly recommend. I was completely new to computer programming, used this book for my Computer Science degree. Read more
Published 10 months ago by SamanthaW
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for similar items by category