cours-info/Variables.java

30 lines
415 B
Java
Raw Normal View History

2019-05-30 06:47:37 +00:00
import static utils.Utils.*;
public class Variables {
public static final void main(String[] args) {
2019-05-30 14:33:36 +00:00
int i = 0;
int j= 1;
2019-05-30 06:47:37 +00:00
2019-05-30 14:33:36 +00:00
int k = ajouter(2, j);
2019-05-30 06:47:37 +00:00
2019-05-30 14:33:36 +00:00
ajouterEtAfficher(2, 4);
2019-05-30 06:47:37 +00:00
2019-05-30 14:33:36 +00:00
afficher(k + 1);
2019-05-30 06:47:37 +00:00
}
2019-05-30 14:33:36 +00:00
public static int ajouter(int a, int b) {
int c = a + b;
return c;
}
public static void ajouterEtAfficher(int a, int b) {
int c = a + b;
afficher("resultat:", c);
}
2019-05-30 06:47:37 +00:00
}