title: Java bicycle and bicycle test
body: <p>I have a problem to write my code. This is a code where I have to create an object class and run it using another class object.
  The program is called bicycle and bicycletest.
  I was given the bicycle program (its already been written) and all I need I write bicycletest to utilize the bicycle.
  Now, the problem is, i have created 2 object, called NiceBicycle and CoolBicycle. I need to change my NiceBicycle name to "Kenny McCormick, but i cant do it. i keep getting error saying 
  "error: variable NiceBicycle might not have been initialized" for this line of command that i write.</p>
  
  <p>// Change the owner's name to Kenny McCormick using setOwnerName
      <code>NiceBicycle.setOwnerName("Kenny McCormick");</code></p>
  
  <p>what should i do?</p>
  
  <p>anyway, here is the bicycle code, and bicycletest that i write based on the instructor command.
  Thank you for your reply</p>
  
  <p>bicycle.java</p>
  
  <pre><code>public class Bicycle
  {
  
  // Instance field
  private String ownerName;
  private int licenseNumber;
  
  // Constructor
  public Bicycle( String name, int license )
  {
       ownerName = name;
       licenseNumber = license;
  }
  
  // Returns the name of this bicycle's owner
  public String getOwnerName()
  {
       return ownerName;
  }
  
  // Assigns the name of this bicycle's owner
  public void setOwnerName( String name )
  {
       ownerName = name;
  }
  
  // Returns the license number of this bicycle
  public int getLicenseNumber()
  {
       return licenseNumber;
  }
  
  // Assigns the license number of this bicycle
  public void setLicenseNumber( int license ) 
  {
       licenseNumber = license;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and here is bicycletest.java that i wrote.</p>
  
  <pre><code>  public class BicycleTest 
     {
  
      public static void main( String[] args )
      {
  
      // Create 1 Bicycle reference variable. For example: myBike
      Bicycle NiceBicycle;
  
      // Create 1 String reference variable for the owner's name
      String name;
  
      // Create 1 integer variable for license number
      int licenceNumber;
  
      // Assign your full name and a license number to the String and
      // integer variables
      name = "Boo Yeah";
      int licenseNumber = 9972;
  
      // Create a Bicycle object with the Bicycle class constructor
      // Use the variables you created as arguments to the constructor
      Bicycle CoolBicycle = new Bicycle( "Boo Yeah", 9972 );
  
      // Output the owner's name and license number in printf statements
      // using the object reference and the get methods.
      // For example: bike.getOwnerName()
      System.out.printf ("The CoolBicycle owner's name is %s\nThe license number is %d\n", CoolBicycle.getOwnerName(), CoolBicycle.getLicenseNumber());
  
      // Change the owner's name to Kenny McCormick using setOwnerName
      NiceBicycle.setOwnerName("Kenny McCormick");
  
      // Output the owner's name and license number in printf statements
        // using the Bicycle object reference variable and the get methods.
        System.out.printf ("The NiceBicycle owner's name is %s\n", NiceBicycle.getOwnerName());
   }
  </code></pre>
  
  <p>}</p>