Class JimsCar

java.lang.Object
  |
  +--JimsCar

public class JimsCar
extends java.lang.Object

This is an example of a Java object, written for Jim's introduction to programming class.


Constructor Summary
JimsCar()
          Create a black JimsCar object.
JimsCar(java.lang.String color)
          This constructor creates a JimsCar object.
 
Method Summary
 java.lang.String getColor()
          Returns the color of the car.
 void goForward()
          Move the car forward.
 void setColor(java.lang.String color)
          Sets the color of the car.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JimsCar

public JimsCar(java.lang.String color)
This constructor creates a JimsCar object.

Parameters:
color - the color of the car

JimsCar

public JimsCar()
Create a black JimsCar object. (No argument passed.)

Method Detail

getColor

public java.lang.String getColor()
Returns the color of the car.

Returns:
the color of the car

setColor

public void setColor(java.lang.String color)
Sets the color of the car.

Parameters:
color - What color would you like it to be?

goForward

public void goForward()
Move the car forward. (If this were a real car - or lego robot - then this method might do more than just print to the screen.)