Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package ojectoriented;
- /**
- *
- * @author Utilizador
- */
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- class bike {
- int cadence = 0;
- int speed = 0;
- int gear = 1;
- void changecadence(int newValue) {
- cadence = newValue;
- }
- void speedUp(int increment) {
- speed = speed + increment;
- }
- void BrackesOn(int decrement) {
- gear = speed - decrement;
- }
- void changegear ( int newValue) {
- gear = newValue;
- }
- void printStates() {
- System.out.println("cadence:"+cadence+"
- speed:"+speed+" gear:"+gear);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement