You may be just getting started with Java after thoroughly learning some other computer language, or you make
just be starting from scratch. Here are some hints to help you come up to speed as quickly as possible.
Learning to Program In Java
I think you should learn the various Java technologies is this order: applications, FileIO, AWT (Advanced Windowing Toolkit), Applets, Swing,
Collections, Enumerations, Generics, Java Web Start, Threads, SQL/JDBC, Servlets, MIDP (Mobile Information Device Profile). Save XML (extensible Markup Language), Java EE (Enterprise Edition), JSP (Java Server Pages), Hibernate… for later. How do you get started in java? here are the suggested steps.
- Download and install the JDK.
- Use regedit to check that the registry entries at My
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Javasoft look plausible. They can get screwed up if you uninstall
or install more than one Java run time.
- Print yourself a copy of the Java Cheat Sheet.
- Collect all the Documentation that is absolutely essential.
- Write the HelloWorld application and get it going. HelloWorld, javac.exe, java.exe, and CLASSPATH.
- Applet entry.
- tutorials, and read up on how to write Java code.
- At least peruse the FAQs — the FAQ (Frequently Asked Questions). FAQ is often a
misnomer. These things are usually littered with esoterica and answers to questions no one ever asked, all
without any sense of priority or categorisation. The Java glossary you are now reading is a type of FAQ, organised as a glossary.
- the gotchas section of the Java & Internet Glossary to warn you about the
common pitfalls. Even if you just skim it now, it will save you months of frustration, because when you hit a
gotcha, in the back of your mind you will remember it, and you can go back to read up on the details.
- the error messages section of the Java & Internet Glossary to explain
what the various compiler and run time error messages separate page for compile time error messages and for the run time error messages.
- Bone up how you are expected to behave in newsgroups. Post your beginner
questions to comp.lang.java.help . Do not cross post them to the more
advanced topics such as comp.lang.java.machine
and comp.lang.java.programmer . Before you post, check the
Java & Internet Glossary and the Java FAQs FAQ. People will be quite rude if you ask a
question already answered in one of the FAQs. They have not the time to wade through material covered a hundred
times before.
- If you are an experienced programmer, just coming up to speed on Java then try the Sun Forums on Java,
- Personal Bookshelf. It will point you to places you can read text
books free online, particularly Thinking in Java .
- Visit a computer bookstore and pick yourself a fat textbook on Java that tackles problems of interest to
you at an appropriate difficulty level. It is better to browse in a real bookstore that to buy online. See
book stores to buy books online and the bookstore comparison shoppers to find out where you can get the books
you want most cheaply.
- Read the events essay.
- Check out IDE to consider an Integrated Development Environment, particularly a
source debugger and class browser.
- Study other people’s source code, e.g. mine. Make simple modifications
to the programs. Make progressively more drastic modifications until you understand how the programs work. Then
you can write your own. Try peppering them with System.out.
println or use your IDE (Integrated Development Environment) ’s debugger to trace them to help understand what they
are up to.
- Check out collections of source code to see how other people solve
various Java problems.
- To learn how to interconvert the basic Java types play with the Conversion Amanuensis. Doing the I/O with the Java conversion classes is a bit
like memorising the irregular French verbs. You need a tutor — the Amanuensis. This includes converting
back and forth between numeric Strings and internal binary formats.
- To learn the Byzantine Java I/O classes, play with the File
IO Amanuensis asking it to generate you source code for all manner of combinations of data and file type.
Doing I/O with the Java classes is a bit like constructing a car out of Lego blocks. You need the Amanuensis to
show you the ropes. Read the binary formats, endian,
println formats and primitives entries.
- Just reading will get you nowhere. You have to read, then apply what you read, alternating read then do.
Give yourself a real project that has some emotional appeal for you. If you can’t think of anything, the
list of student projects.
- Read How To Write Unmaintainable Code and carefully avoid following its
advice.
- Check out the Newbie essay to see if you are falling into the common bad habits
most newbies pick up.
- Check out the section on dealing with tough homework problems. It is useful for
tackling tough problems generally.
- To deal with feelings of panic and overwhelm, read the tharn entry.
- I have written all kinds of Java applications and Applets with free source you can look at. Pick one that
interests you. Download the source, study it, then start playing with it, making
simple modifications, e.g. changing colours and fonts, changing the text labels. Then work up to more major
changes, adding buttons, changing the layout… You almost never write an application completely from
scratch. You find something vaguely similar and step by step hammer it into the new shape. The advantage you
have something working to play with at each stage. In these early experiments, you don’t need to plan
ahead. Imagine you are potter edging your metaphorical electronic clay a little closer at a time to what you
want.
- Write some applications.
- Write some Applets.
- Write some Java Web Start applications.
- Tackle SQL (Standard Query Language)/JDBC (Java Data Base Connectivity).
- Tackle Servlets.
- Tackle MIDP (cell phones and handhelds).
- Tackle a Servlet framework such as JSP.
- Tackle JavaMail.
- Tackle JCE (Java Cryptography Extension) encryption.
- Tackle Hibernate
- Tackle EE.
Finding Roedy’s Recommended Books
If you have Google Desktop installed and if
you are reading a local mirror copy of my website provided via the
Replicator, you can do a Google desktop search with: filetype:html
"recommend book", (note the exact-search
quotes) and Google Desktop will find you my book referrals sprinkled throughout
the mindprod.com site, about whatever other search
criteria you add.
Note the spelling of recommend — one c,
two ms, not
reccommend or recomend or reccommend. You have to spell it
exactly in the form of a command: "recommend book",
not "recommend books" or "recommended book" or "recommend
a book".
This feature will also kick in later using an ordinary web browser Google.com
site search with site:mindprod.com "recommend book"
for people who browse the ordinary way, when Google next indexes the mindprod.com
website.
Incidentally, Google Desktop will let you find
anything else on the mindprod.com website with
indexes that are only seconds out of date.
You can similarly find my DVD (Digital Video Disk) recommendations with filetype:html
"recommend DVD" in Google Desktop and site:mindprod.com
"recommend book" in an ordinary web browser Google site search.
You can also use Google
Books to search for books, and browse them online to various degrees. You
can also use or Copernic, which I find generally
faster and more reliable that Google Desktop. Just search for recommend
book without quotes. You might optionally set the filetype to html to
narrow the search.
Selecting Books
Don’t buy a book just because others, even me, said it was good. Read as much of it as you can before you
buy to make sure it is not too basic or too advanced. A book utterly the best for others, may be too advanced for
you, for now. It won’t get any more comprehensible once you take it home, and it will just languish on the
shelf.
If you possibly can, go to a brick and mortar bookstore and browse the books. Watch out for:
- fluff, material you can get elsewhere such as the Javadoc for Swing.
- stuff that is too obvious.
- stuff obviously way over your head. It should be a stretch, but not a leap.
Look for:
- Lots of example code, especially complete programs you can run and tinker with. Sometimes they come on a
CD (Compact Disk).
- a good index. Try looking up a few things of current interest.
- chapter summaries.
- Evidence the author has actually used the classes he writes about, e.g. gotchas,
warnings of things that don’t work the way you would expect or bugs, or tips on the best ways to combine
the tools.
I like O’Reilly books. They tend to be deep, narrowly focused on a specific
topic, slim and accurate. I am not impressed by the fat fluffy books from Que.
One of my brick and mortar bookstore tests for a book is to read the first few and the last few pages. The
first few pages should assume only things I already know, and be easy to read. The last few pages should assume
significantly more knowledge than I have, and be somewhere between difficult and impossible to read. This test
eliminates both books that are completely beyond me, and books that teach nothing I don’t already know.
~ Patricia Shanahan
Beginner Books
 |
recommend book⇒Head First Java, Second Edition |
| by: | Bert Bates, Kathy Sierra |
978-0-596-00920-5 | paperback |
| publisher: | O’Reilly  |
| published: | 2005-02-09 |
| A beginners’ book that not only has the depth it’s also an entertaining and thought-provoking read. If you have no computer programming experience at all, this is the best starting place. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Just Java 2, Sixth Edition |
| by: | Peter van der Linden |
978-0-13-148211-1 | paperback |
| publisher: | Prentice Hall |
| published: | 2004-07-01 |
| Covers Java 5 aka 1.5. Peter has a sense of humour and breaks the drudgery of reading with a funny story at the end of each chapter. He explains through simple examples. This is a book you can sit down and read and not fall asleep. I helped edit and proofread the chapters on enums and genericity. This is good introduction that won’t overwhelm you. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Java: How to Program |
| by: | Paul J. Deitel, Harvey M. Deitel |
978-0-13-012507-1 | paperback |
| publisher: | Prentice Hall |
| published: | 1999-12-15 |
| It is 1355 pages, with lots of examples and a broad coverage of Java-related topics. It covers JDK 1.2. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Java: An Introduction to Computer Science & Programming (2nd Edition) |
| by: | Walter J. Savitch |
978-0-13-031697-4 | paperback |
| publisher: | Prentice Hall |
| published: | 2000-12-15 |
| Good for beginners to computer programming. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Core Java 2, Volume I: Fundamentals (6th Edition) |
| by: | Cay Horstmann and Gary Cornell |
978-0-13-047177-2 | paperback |
| publisher: | Prentice Hall |
B000OZ0N44 | kindle |
| published: | 2002-08-22 |
| Covers Java 1.4 such as regular expressions, New I/O, assertions, Preferences, Swing enhancements and logging. Aimed at someone who already knows C++. This is not a fluffy introductory book. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Core Web Programming, Second Edition |
| by: | Marty Hall and Gary Cornell |
978-0-13-089793-0 | paperback |
| publisher: | Prentice Hall |
| published: | 2001-06-03 |
| 1250 pages. This is a great doorstop of a book. It has a few chapters on client-server programming in Java, and a section of that is on CGI. I have looked at hundreds of Java books and found nothing that deals in depth with client side Java talking to CGI, except Marty’s book. It is really very simple and he does an excellent job of explaining it. Marty has posted all the source code examples from the book for anyone to use. These contain updates and errata fixes you don’t get on the CD-ROM that comes with the book. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Java Precisely |
| by: | Peter Sestoft |
978-0-262-69325-7 | paperback |
| publisher: | The MIT Press |
| published: | 2005-08-01 |
| If you already know other languages and don’t want a fluffy beginner’s book this may be for you. It concisely and completely covers Java in 100 pages. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Introduction to Java Programming: Fundamentals First, Sixth Edition |
| by: | Y. Daniel Liang |
978-0-13-223738-3 | paperback |
| publisher: | Prentice Hall |
| published: | 2006-07-21 |
| Liang is a university professor, so this is written (and priced) as a university first year level text book. It covers the new features of Java 1.5. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Introduction to Java Programming: Comprehensive Edition, Sixth Edition |
| by: | Y. Daniel Liang |
978-0-13-222158-0 | paperback |
| publisher: | Prentice Hall |
| published: | 2006-07-22 |
| Liang is a university professor, so this is written (and priced) as a university level text book. It presumes you already know the basics. It covers the new features of Java 1.5. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒A Programmer’s Guide to Java Certification: A Comprehensive Primer, Second Edition |
| by: | Khalid A. Mughal and Rolf Rasmussen |
978-0-201-72828-6 | paperback |
| publisher: | Addison-Wesley |
| published: | 2003-08-14 |
| Khalid A. Mughal is a professor at the University of Bergen in Norway. This book is to help you pass the Sun Certified Programmer for Java 2 Platform 1.4 exam, but it is also useful for gaining a deeper understanding of Java. Mughal has a terse clear way of writing. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Java Actually: A First Course in Programming |
| by: | Khalid A. Mughal, Torill Hamre and Rolf Rasmussen |
978-1-84480-418-4 | paperback |
| publisher: | Int. Thomson Business Press |
| published: | 2007-01-31 |
| Khalid A. Mughal is a professor at the University of Bergen in Norway. This is book suitable for a first course in computer science that presumes no prior knowledge, but a bright mind. Mughal has a terse clear way of writing. |
|
| Greyed out stores probably do not have the item in stock |
 |
recommend book⇒Learning Java, Third Edition |
| by: | Pat Niemeyer, Jonathan Knudsen |
978-0-596-00873-4 | paperback |
| publisher: | O’Reilly  |
| published: | 2005-05-01 |
| Covers Java 1.5, including generics, Java 1.4 enums, but not Java 1.6 annotations. Particularly good at explaining the use of the Java 1.2 Collection classes. Teaches with example code, my favourite technique. It has a tiger on the cover because Sun’s code name for Java 1.5 was Tiger. |
|
| Greyed out stores probably do not have the item in stock |
Learning More