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 (Frequently Asked Questionses). 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 Oracle
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 (cellphones 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 Disc) 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 Disc).
- 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
Book referral for Core Java Volume I-Fundamentals (10th Edition) (Core Series)
|
recommend book⇒Core Java Volume I-Fundamentals (10th Edition) (Core Series) |
by |
Cay S. Horstmann |
978-0-13-417730-4 |
paperback |
birth |
1959-06-16 age:58 |
978-0-13-417735-9 |
eBook |
publisher |
Prentice Hall |
B019PFBM0M |
kindle |
published |
2016-01-01 |
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. Try looking for it with a bookfinder. |
Book referral for Java SE8 for Programmers (3rd Edition) (Deitel Developer Series)
|
recommend book⇒Java SE8 for Programmers (3rd Edition) (Deitel Developer Series) |
by |
Paul Deitel, Harvey Deitel |
978-0-13-389138-6 |
paperback |
publisher |
Prentice Hall |
978-0-13-389151-5 |
eBook |
published |
2014-04-09 |
B00JC9I3RC |
kindle |
This is book for experienced programmers to learn all of Java including JDK 1.8. It works primarily with code examples. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Java How To Program (Early Objects) (10th Edition)
|
recommend book⇒Java How To Program (Early Objects) (10th Edition) |
by |
Paul Deitel, Harvey Deitel |
978-0-13-380780-6 |
paperback |
publisher |
Prentice Hall |
978-0-13-380793-6 |
eBook |
published |
2014-03-06 |
978-0-13-381303-6 |
WebBook |
|
B00IO7DD2I |
kindle |
This is an extremely expensive paperback. You normally only see paperbacks this costly aimed at a tiny academic market. It contains source for hundreds of complete working programs. This is my complaint with most books. They tend to show you just snippets leaving you at a loss with what sort of sandwich they need to make them work. The course MyProgramming lab is extra! |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Learning Java, fourth edition
|
recommend book⇒Learning Java, fourth edition |
by |
Patrick Niemeyer and Jonathan Knudson |
978-1-4493-1924-3 |
paperback |
publisher |
O’Reilly |
978-1-4493-7249-1 |
eBook |
published |
2013-06-25 |
B00DDZPC9I |
kindle |
Covers Java 1.7 though nearly all of it is about older features, including enums and generics. Covers serialisation vs code generation. 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 Oracle’s code name for Java 1.5 was Tiger. Contains a very good chapter on generics. The book is not for people new to programming. This is the book Mark Space recommends, especially to learn OO programming. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Introduction to Java Programming, Brief Version, ninth edition
|
recommend book⇒Introduction to Java Programming, Brief Version, ninth edition |
by |
Y. Daniel Liang |
978-0-13-292373-6 |
paperback |
publisher |
Prentice Hall |
978-0-13-295525-6 |
eBook |
published |
2012-03-11 |
B007O10XWI |
kindle |
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.7. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Java 7 New Features Cookbook
|
recommend book⇒Java 7 New Features Cookbook |
by |
Richard M. Reese, Jennifer L. Reese |
978-1-84968-562-7 |
paperback |
publisher |
Packt |
978-1-84968-563-4 |
WebBook |
published |
2012-02-23 |
B007E6YCC0 |
kindle |
It covers only Java features introduced in Java 7, things such things as the diamond operator, catching multiple exceptions, symbolic links, POSIX file attributes, ACL, ZIP filesystems, Currency. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Murach’s Java Programming, fourth edition
|
recommend book⇒Murach’s Java Programming, fourth edition |
by |
Joel Murach |
978-1-890774-65-3 |
paperback |
birth |
1968 age:49 |
978-1-890774-65-3 |
eBook |
publisher |
Mike Murach |
published |
2011-11-04 |
Teaches basic Java programming including GUI and databases. It also covers the main Java 1.7 features such as the try-with-resources statement, the diamond operator (<>) and the nio2 file accessors. I suspect the eBook may only be available direct from the publisher. Confusingly it has the same ISBN as the paperback. book website |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Java 7: A Beginner’s Tutorial, third edition
|
recommend book⇒Java 7: A Beginner’s Tutorial, third edition |
by |
Budi Kurniawan |
978-0-9808396-1-6 |
paperback |
publisher |
BrainySoftware |
978-0-9808396-1-6 |
eBook |
published |
2011-10-01 |
B005NINIX0 |
kindle |
Covers all of Java, not just the new features in Java 1.7. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Java: An Introduction to Problem Solving and Programming, 6th edition
|
recommend book⇒Java: An Introduction to Problem Solving and Programming, 6th edition |
by |
Walter J. Savitch |
978-0-13-216270-8 |
paperback |
publisher |
Addison Wesley |
978-0-13-140169-3 |
hardcover |
published |
2011-02-24 |
978-0-13-275241-1 |
eBook |
|
B008UFX37Y |
kindle |
Good for beginners to computer programming. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for A Programmer’s Guide to Java SE 8 Oracle Certified Associate (OCA)
|
recommend book⇒A Programmer’s Guide to Java SE 8 Oracle Certified Associate (OCA) |
by |
Khalid A Mughal, Rolf W Rasmussen |
978-0-13-293021-5 |
paperback |
publisher |
Addison-Wesley Professional |
978-0-13-294311-6 |
eBook |
published |
2016-07-30 |
978-0-13-294309-3 |
WebBook |
|
B01ITNCBVK |
kindle |
Khalid A. Mughal is a professor at the University of Bergen in Norway. This book is to help you pass the SCJP Oracle Certified Programmer for Java 1.8 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. Try looking for it with a bookfinder. |
Book referral for Murach’s Java SE 6: Training & Reference
|
recommend book⇒Murach’s Java SE 6: Training & Reference |
by |
Joel Murach, Andrea Steelman |
978-1-890774-42-4 |
paperback |
publisher |
Mike Murach |
978-1-890774-42-4 |
eBook |
published |
2007-04-20 |
Does not cover Java 1.7. Also covers practical matters like how to install Java. He focuses on the practical matter of getting you writing code as soon as possible and delaying learning anything outside the core of what you need to know. I suspect the eBook may only be available direct from the publisher. Confusingly it has the same ISBN as the paperback. book website |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Java Actually: A First Course in Programming
|
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 |
International Thomson Business |
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. Try looking for it with a bookfinder. |
Book referral for Java Precisely
|
recommend book⇒Java Precisely |
by |
Peter Sestoft |
978-0-262-69325-7 |
paperback |
publisher |
MIT |
B00LG92GKG |
kindle |
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. Try looking for it with a bookfinder. |
Book referral for Head First Java, second edition
|
recommend book⇒Head First Java, second edition |
by |
Bert Bates, Kathy Sierra |
978-0-596-00920-5 |
paperback |
publisher |
O’Reilly |
978-1-4493-3144-3 |
eBook |
published |
2005-02-09 |
B0064U8GYC |
kindle |
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. Try looking for it with a bookfinder. |
Book referral for Just Java 2, sixth edition
|
recommend book⇒Just Java 2, sixth edition |
by |
Peter van der Linden |
978-0-13-148211-1 |
paperback |
publisher |
Prentice Hall |
978-0-13-700990-9 |
eBook |
published |
2004-07-01 |
978-0-13-493982-7 |
audio |
|
B001MDC0FW |
kindle |
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. Try looking for it with a bookfinder. |
Book referral for Java Cookbook, Second Edition
|
recommend book⇒Java Cookbook, Second Edition |
by |
Ian F. Darwin |
978-0-596-00701-0 |
paperback |
publisher |
O’Reilly |
978-0-596-55520-7 |
eBook |
published |
2004-06-21 |
B0043GXMTI |
kindle |
This is a book that teaches with examples. You don’t have to fully understand them to use the code. It covers only up to JDK 1.5. |
|
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
Book referral for Core Web Programming, second edition
|
recommend book⇒Core Web Programming, second edition |
by |
Marty Hall and Gary Cornell |
978-0-13-089793-0 |
paperback |
publisher |
Prentice Hall |
978-0-613-92274-6 |
hardcover |
published |
2001-06-03 |
1250 pages. Also has some simple RMI examples. 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. Try looking for it with a bookfinder. |
Learning More