Created
March 6, 2015 20:40
-
-
Save ilyeshammadi/6224607462c3734f1472 to your computer and use it in GitHub Desktop.
Creation d'une class Etudiant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
/** | |
* Created by Hammadi Ilyes Ahmed on 02/03/2015. | |
*/ | |
public class Etudiant { | |
private String nom; | |
private String eMail; | |
private int age; | |
// constructor | |
public Etudiant(String nom, String eMail, int age) { | |
this.nom = nom; | |
this.eMail = eMail; | |
this.age = age; | |
} | |
// set | |
public void setNom(String nom) { | |
this.nom = nom; | |
} | |
public void seteMail(String eMail) { | |
this.eMail = eMail; | |
} | |
public void setAge(int age) { | |
this.age = age; | |
} | |
// get | |
public String getNom() { | |
return nom; | |
} | |
public String getEMail() { | |
return eMail; | |
} | |
public int getAge() { | |
return age; | |
} | |
// class method | |
public void afficheInfo(){ | |
System.out.println("salut je m'apelle " + this.nom + " jai " + this.age + " mon e-mail " + this.eMail); | |
System.out.println(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment