Probleme attribut
Résolu
helloworld95
-
helloworld95 -
helloworld95 -
Bonjour,
J'ai une classe Client avec un attribut commande. Le problème est que le résultat de getNumero() est 0 alors qu'il devrait etre 2.
J'ai une classe Client avec un attribut commande. Le problème est que le résultat de getNumero() est 0 alors qu'il devrait etre 2.
public class Client { private String nom, prenom; private Commande commande; public Client(String prenom, String nom) { this.prenom = prenom; this.nom = nom; } public void enregistrerCommande(Commande commande) { this.commande = commande; } public Commande getCommande() { return this.commande; }
public class Test { public static void main(String[] args) { Client client = new Client("Robert", "Michel"); Commande commande = new Commande(2, LocalDateTime.now()); client.enregistrerCommande(commande); System.out.println(client.getCommande().getNumero()); }
A voir également:
- Aucun attribut manifest principal dans
- Secteur de démarrage principal ou partition gpt ✓ - Forum Matériel & Système
- Faire de cet écran l'écran principal grisé - Forum Windows
- Changer d'écran principal ✓ - Forum Windows
- Attribut changer - Télécharger - Divers Utilitaires
- Comment faire revenir une fenetre ecran principal - Guide