Here are the steps I recommend:
Setup
- Install Java JDK 1.6
- Install Eclipse and hook it up the the JDK (not JSE) - All java documentation (JavaDoc) and library source code will be visible to Eclipse. This speeds up learning Java incredibly, as you can also see how a lot of Java's base is written.
Java basics
- Stick to primatives and static methods and learn some basic syntax.
- Learn the basic Objects (String, Integer, etc.) and arrays.
- Learn what the following descriptors mean: public, private, protected, final, static (hold off on 'transient' until later)
- Learn object inheritance
- Understand interfaces
- Learn 'abstract' descriptor
- Learn about enums
- Learn about the difference between String and StringBuffer (immutable vs. mutable)
- Learn about packages and begin using them right away
- Learn Exception/Throwable class. Learn 'try', 'catch', 'finally', and 'throws'. Learn the difference between checked exceptions (exceptions that extend Exception) and unchecked exception (exceptions that extend RuntimeException).
- Learn the basic organization of a class according to some java coding standard (I like inner classes first, then static fields, static methods, then instance fields, instance methods. Order fields and methods by public, protected, default, private.) Additionally, learn how to write JavaDoc comments right away.
At this point, most of the foundation in Java's structure should be clear. Now to pick up some of the fundamental classes available:
- I feel the most important library (besides the basic objects mentioned above) is the Collections (java.util.Collection and subinterfaces and implementing classes), especially List<E>/ArrayList and Map<K,V>/HashMap. Become very familiar with these. The collections will help you learn to program to an interface instead of an implementation and learn how generics work. Observe the source code to some of these classes to learn how to program generics.
- Learn how Iterators work, varargs, and the foreach loop
- Learn Comparable/Comparator, Calendar/Date, Formatter
Then depending on your needs, start looking into the following stuff:
- File, InputStream/OutputStream and super classes
- BigDecimal (high precision math)
- Thread, Runnable, the descriptor 'synchronized' together with Object.notify() and Object.wait()
- java.sql.* basics: Connection, Statement/PreparedStatement, ResultSet
- Pattern and Matcher if you like regular expressions
Now that you have most of the Java core under your belt, you can proceed to other frameworks. Each framework will probably take considerable time to learn. For example:
- Creating jars: I would recommend 'Apache Ant' if you are used to 'make' for other languages. The other popular packager is called Maven.
- Logging: log4j is a nice library
- Apache commons libraries have a lot to offer
- Database persistence: Learn JPA annotations, don't think 'Hibernate' or 'Toplink' or whatever. If you stick to the JPA standard as much as possible, it's really simple to change back and forth between implementations. Toplink has far fewer dependencies and is therefore easier to get running.
- Webpages: look at JSP and Java Faces
- Webservices: Axis/Axis2 is rather popular
- XML parsing: Jaxb, XPath
Advanced java core stuff (not really necessary until you need it):
- Seriablizable (here is the transient descriptor) and RMI (remote method innvocation)
- The Reflection API - for accessing methods and fields dynamically
- Swing: A model/view/controller pattern for standalone applications
Yeah. I would say that is a fair road map.