Author: Paul J. Deitel & Harvey M. Deitel
Publisher: Prentice Hall, 2011
Audience: Programmers moving to Java; students
Reviewed by: Ian Elliot
The latest edition of the Deitel tome on Java has been updated to include new facilities in Java SE8.
I really didn't get on with this book but as some readers seem to like the approach used by the Deitel books, don't let this put you off. This is a third edition so the book is obviously popular with enough readers to warrant the update.
Perhaps the reason is that it is successful despite being dull is that it makes a good course book.
The general Deitel approach is to create something massive and something more like an academic textbook than an inspiring read.
It has to be said that this particular 1100-page brick does its best to be helpful and friendly by including short notes on common mistakes in programming. This makes it slightly less intimidating, but to be honest the layout and the very small print probably make the effort futile. It just looks like a hard read. On the other hand if you are looking for a book that covers the ground then you can't really fault this volume.
The book covers Java 8 SE from the first concepts, through objects, the user interface, graphics, JDBC, generics and so on.
Although supposedly aimed at "programmers" the text starts off more or less from first principles. If you already program in any object-oriented language then there is a lot you will need to skip. It starts off from an overview of objects, how to compile a hello world program and then basic classes and methods. Next come the two chapters on flow of control and for the beginner this is going to be too much because it covers everything. If you are just struggling with the concept of a loop you really don't want to deal with all of the possible variations. The approach is complete rather than graduated even though the explanations are always very basic. If you want a book that does it all then this is a plus point.
From flow of control the next topic is to look at methods in more depth. This makes sense because it provides an opportunity to look at modular programming without having the clutter of objects. However it still might be more than a beginner wants to know at first encounter. The next chapter focuses on Arrays and the ArrayList before moving on to classes and object in general. At this point we have a fairly standard introduction to OOP - encapsulation, inheritance and polymorphism with a side order of interfaces. The final chapter on core language features looks at exception handling.
Overall this is a fairly basic introduction to Java but it doesn't really prepare the ground for what is to come next. For example the early chapters don't introduce inner or anonymous classes so when we hit the first chapter on the Swing library they are introduced as part of ways to handle events. It would be better to tackle the problem that Java has with implementing events - you can't pass a method as an event handler only a complete object - as a core topic. There are two chapters on Swing which take you though all of the basics of using different controls rather than emphasising deeper organizational principles.
Of course the book does everything without the help of an IDE and so you don't get to use a drag-and-drop designer as included in say NetBeans. What is slightly odd is the way that JavaFX is introduced at the end of the book with the suggestion that it is different because is uses a designer closely coupled with NetBeans. If you want to Swing can be used in this way as well.
We also have a look at general 2D graphics before moving on to a set of unrelated topics - strings, regular expressions, file handling and generics.
At Chapter 17 we hit the first big new SE8 topic - lambdas and streams. This is a bit of a change of orientation because we have an introduction to functional programming were previously the book has been 100% OOP. As you might guess this isn't a very convincing look at the alternative approach. However this probably does fit in with the average Java programmers view of lambdas - i.e. a way of passing functions around. Of course this means that Java does now have a good way of defining and working with event handlers something that is mentioned almost in passing.
From this point the book is clearly on a rush to get to the end. Various topics included in earlier editions have been removed - Applets, Java Web Start, Networking, JavaServer Faces and Web services.
What topics are in?
Threading, database access with JDBC and JavaFX.
The book comes to a close with two chapters on a case study involving the design of an ATM and some appendices on using the debugger, Javadoc and so on.
If you are a beginner, the order in which the material is introduced isn't particularly helpful, nor is the introduction of advanced concepts such as UML and object oriented design right at the start. It can be hard enough to learn that language without having to cope with abstract ideas as well - these can be left for later.
There are also a lot of places where, admittedly simple, concepts are used and then covered later. In short the authors don't seem to have a clear idea of who their audience is and as a result have ended up producing a book that isn't exactly right for any particular level of experience. What they seem to have in mind is to create a comprehensive text book that can be used with the guidance of a teacher to plot a course thought the book to suit the students.
If you can cope with skim reading through some of the very basic stuff then it might be of value to an experienced programmer needing to brush up your Java with a UML/object-oriented flavour.
The best things I can find to say about it is that it's "big" and comprehensive. If you are looking for a course textbook then this deserves a look, but for self-study it is hard work.