This commit is contained in:
Simoes Lukas
2025-03-04 13:22:24 +01:00
parent 422a41d232
commit 9441c8978a
16 changed files with 170 additions and 0 deletions

22
DEV2.1/TP07/Test.java Normal file
View File

@@ -0,0 +1,22 @@
import javax.swing.JOptionPane;
public class Test {
public static void main(String[] args) {
Vehicule v;
Object[] choix = {"Voiture", "Moto"};
int reponse = JOptionPane.showOptionDialog(null,
"Quel v\u00E9hicule choisissez-vous ?",
"Question",
JOptionPane.DEFAULT_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
choix,
null);
if (reponse == 0)
v = new Voiture();
else
v = new Moto();
System.out.println("Une "+v.sorte()+" poss\u00E8de "+v.nbRoues()+" roues.");
}
}