Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 22nd, 2010  |  syntax: Java  |  size: 0.95 KB  |  views: 157  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package ojectoriented;
  7.  
  8. /**
  9.  *
  10.  * @author Utilizador
  11.  */
  12. public class Main {
  13.  
  14.     /**
  15.      * @param args the command line arguments
  16.      */
  17.     public static void main(String[] args) {
  18.         // TODO code application logic here
  19.     class bike {
  20.         int cadence = 0;
  21.         int speed = 0;
  22.         int gear = 1;
  23.  
  24.         void changecadence(int newValue) {
  25.             cadence = newValue;
  26.         }
  27.  
  28.         void speedUp(int increment) {
  29.             speed = speed + increment;
  30.         }
  31.         void BrackesOn(int decrement) {
  32.             gear = speed - decrement;
  33.         }
  34.         void changegear ( int newValue) {
  35.             gear = newValue;
  36.          }
  37.         void printStates() {
  38.             System.out.println("cadence:"+cadence+"
  39.                                speed:"+speed+" gear:"+gear);
  40.         }
  41.        
  42.     }
clone this paste RAW Paste Data