You can access sample code and a presentation from our Comcast FIRST Bootcamp. I presented a section on JAVA/C++. I has a review of Java basics and it presents a method to build your robot code on. This method makes the process very logical, flexible and creating multiple autonomous programs very, very easy.
http://www.frc272.com/files/seminar/Archive/
Good luck... have fun...
Email me directly at
pafwl@aol.com.
PS - There is a presentation on using Sensors included and examples in the code.