/*
File: Bicycle.java
*/
public class Bicycle {
// Instance field
public String ownerName;
public 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 number ) {
licenseNumber = number;
}
}
ok so now i need to add a no argument constructor to this class. what is the best way to go about doing this?
This post has been edited by pyr0b0y: 23 February 2009 - 12:22 AM

New Topic/Question
Reply




MultiQuote






|