This commit is contained in:
Vieira
2022-02-08 15:59:04 +01:00
parent 04d989559e
commit 67ab03f916
15 changed files with 181 additions and 17 deletions

Binary file not shown.

View File

@@ -0,0 +1,18 @@
public class Compteur {
private int compte;
public Compteur() {
this.compte = 0;
}
public Compteur(int h) {
this.compte = h;
}
// méthode
public void plusUn() {
this.compte++;
}
// autre méthode
public String toString() {
return Integer.toBinaryString(this.compte);
}
}

Binary file not shown.

View File

@@ -0,0 +1,9 @@
public class Progression {
public static void main(String[] args) {
Compteur c = new Compteur(5);
for (int i=0;i<5;i++){
System.out.println(c);
c.plusUn();
}
}
}