Biblioteca Java - Blame information for rev 4
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
4 | mihai | 1 | package oop.masina; |
2 | |||
3 | |||
4 | public class CutieViteza { | ||
5 | int treapta; | ||
6 | int nr; | ||
7 | |||
8 | public CutieViteza(int nr) { | ||
9 | this.nr = nr; | ||
10 | } | ||
11 | |||
12 | void sus(){ | ||
13 | if(treapta<nr){ | ||
14 | treapta = treapta +1; | ||
15 | System.out.println("Incrementeaza treapta "+treapta); | ||
16 | } | ||
17 | } | ||
18 | |||
19 | void jos(){ | ||
20 | if(treapta>-1){ | ||
21 | treapta = treapta -1; | ||
22 | System.out.println("Decrementeaza treapta "+treapta); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | int treaptaCurenta(){ | ||
27 | return treapta; | ||
28 | } | ||
29 | } |