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
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 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 errormessages 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 Frequently Asked Questions. 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 on-line, 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 on-line. See book
stores to buy books on-line 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’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.
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 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 on-line 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.
- 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 focussed 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 |
| | paperback |
|---|
| ISBN10: | 0-596-00465-6 |
|---|
| ISBN13: | 978-0-596-00465-1 |
|---|
| publisher: | O’Reilly  |
| published: | 2003-05-21 |
| by: | Bert Bates, Kathy Sierra |
| 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. |
|
 |
recommend book⇒Just Java 2, Sixth Edition |
| | paperback |
|---|
| ISBN10: | 0-13-148211-4 |
|---|
| ISBN13: | 978-0-13-148211-1 |
|---|
| publisher: | Prentice Hall |
| published: | 2004-07-01 |
| by: | Peter van der Linden |
| 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. |
|
 |
recommend book⇒Java: How to Program |
| | paperback |
|---|
| ISBN10: | 0-13-012507-5 |
|---|
| ISBN13: | 978-0-13-012507-1 |
|---|
| publisher: | Prentice Hall |
| published: | 1999-12-15 |
| by: | Paul J. Deitel, Harvey M. Deitel |
| It is 1355 pages, with lots of examples and a broad coverage of Java-related topics. It covers JDK 1.2. |
|
 |
recommend book⇒Java: An Introduction to Computer Science & Programming (2nd Edition) |
| | paperback |
|---|
| ISBN10: | 0-13-031697-0 |
|---|
| ISBN13: | 978-0-13-031697-4 |
|---|
| publisher: | Prentice Hall |
| published: | 2000-12-15 |
| by: | Walter J. Savitch |
| Good for beginners to computer programming. |
|
 |
recommend book⇒Core Java 2, Volume I: Fundamentals (6th Edition) |
| | paperback |
|---|
| ISBN10: | 0-13-047177-1 |
|---|
| ISBN13: | 978-0-13-047177-2 |
|---|
| publisher: | Prentice Hall |
| published: | 2002-08-22 |
| by: | Cay Horstmann and Gary Cornell |
| Covers JDK 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. |
|
 |
recommend book⇒Core Web Programming, Second Edition |
| | paperback |
|---|
| ISBN10: | 0-13-089793-0 |
|---|
| ISBN13: | 978-0-13-089793-0 |
|---|
| publisher: | Prentice Hall |
| published: | 2001-06-03 |
| by: | Marty Hall and Gary Cornell |
| 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. |
|
 |
recommend book⇒Java Precisely |
| | paperback |
|---|
| ISBN10: | 0-262-69325-9 |
|---|
| ISBN13: | 978-0-262-69325-7 |
|---|
| publisher: | The MIT Press |
| published: | 2005-08-01 |
| by: | Peter Sestoft |
| 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. |
|
 |
recommend book⇒Introduction to Java Programming: Fundamentals First, Sixth Edition |
| | paperback |
|---|
| ISBN10: | 0-13-223738-5 |
|---|
| ISBN13: | 978-0-13-223738-3 |
|---|
| publisher: | Prentice Hall |
| published: | 2006-07-21 |
| by: | Y. Daniel Liang |
| 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. You can check out the book on the author’s website. |
|
 |
recommend book⇒Introduction to Java Programming: Comprehensive Edition, Sixth Edition |
| | paperback |
|---|
| ISBN10: | 0-13-222158-6 |
|---|
| ISBN13: | 978-0-13-222158-0 |
|---|
| publisher: | Prentice Hall |
| published: | 2006-07-22 |
| by: | Y. Daniel Liang |
| 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. You can check out the book on the author’s website. |
|
 |
recommend book⇒A Programmer’s Guide to Java Certification: A Comprehensive Primer, Second Edition |
| | paperback |
|---|
| ISBN10: | 0-201-72828-1 |
|---|
| ISBN13: | 978-0-201-72828-6 |
|---|
| publisher: | Addison-Wesley |
| published: | 2003-08-14 |
| by: | by Khalid Mughal and Rolf Rasmussen |
| Khalid 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. |
|
 |
recommend book⇒Java Actually: A First Course in Programming |
| | paperback |
|---|
| ISBN10: | 1-84480-418-6 |
|---|
| ISBN13: | 978-1-84480-418-4 |
|---|
| publisher: | Int. Thomson Business Press |
| published: | 2007-01-31 |
| by: | by Khalid Mughal, Torill Hamre and Rolf Rasmussen |
| Khalid 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. |
|
 |
recommend book⇒Learning Java, Third Edition |
| | paperback |
|---|
| ISBN10: | 0-596-00873-2 |
|---|
| ISBN13: | 978-0-596-00873-4 |
|---|
| publisher: | O’Reilly  |
| published: | 2005-05-01 |
| by: | Pat Niemeyer, Jonathan Knudsen |
| 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. |
|
Learning More