Learning Java

Hi everyone.

I really want to learn how to program using java.
Does anyone know what is the best way for me to learn the language?

Thanks.

Sincerely,

Austin Bianchini

There isn’t really a best way. You have to self-explore with guidance from tutorials, guides, books, or mentors.

There is a Getting Started guide for specifically programming for the robot available on this page http://first.wpi.edu/FRC/frcjava.html

There are plenty of resources available to help you and there’s always places and people to ask questions if you get stuck.

If you’re familiar with another OOP language (C++, Python, even parts of PHP), then you’re already halfway there. If this is the case, then you simply need to learn the syntax, nagging rules and guidelines, etc. I recommend through the Getting Started guide that ZonChau mentioned. While it’s not a “beginner’s guide” to Java, it does introduce you to programming the robot in Java. How to include classes, how to use some basic functions, etc. The rest, I pretty much learned from just Googling.

There is an online (and downloadable) Java SE tutorial that is a good place to start learning Java. Java SE = “Standard Edition”, which is the version of java designed for desktops and servers. Since Java for FRC is based on the ME (“Micro-edition”), there are some parts of the tutorial you can skip over:

Starting from http://download.oracle.com/javase/tutorial/ there are several “trails” to follow:

  1. Getting Started - “Hello World” and Java marketing
  2. Learning the Java Language - fundamentals of programming. Can skip:
  • “Enum Types” and “Annotations”

  • “Generics” section.

  1. Essential Java Classes - Cover only these sections:
  • Exceptions

  • Basic I/O - Byte, Character, Buffered, and Data streams

  • Concurrency - but skip over “High Level Concurrency Objects” and any mention of classes in java.util.concurrent.

You can find the full API documentation (javadoc) for Java ME, WPILibJ, and the Squawk JVM in the Java for FRC SDk once you install it, in sunspotfrcsdk/doc/javadoc/index.html. You can also see the Java ME API set online at http://download.oracle.com/javame/config/cldc/ref-impl/cldc1.1/jsr139/index.html.