Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Bicycle
- {
- int speed;
- int gear;
- public Bicycle(int speed, int gear) {
- super();
- this.speed = speed;
- this.gear = gear;
- }
- public int getSpeed() {
- return speed;
- }
- public void setSpeed(int speed) {
- this.speed = speed;
- }
- public int getGear() {
- return gear;
- }
- public void setGear(int gear) {
- this.gear = gear;
- }
- public String toString()
- {
- return "The speed of bicycle" + speed + "/n The gear of Bicycle " + gear;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement