View Single Post
  #5   Spotlight this post!  
Unread 13-01-2011, 13:07
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,753
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Working with java classes

Yes, the robot starts out running the main, and that is always static. It's the same way with java programs - you create a static main method that's responsible for launching everything else. Within that static main method, create your objects for everything else you want to do. For example:

Code:
public static void main(string[] args)
{
    RobotCode myCode = new RobotCode();
    while (myCode.isEnabled())
    {
        //do stuff
    }
}