Skip to content

Instantly share code, notes, and snippets.

@ilyeshammadi
Created March 6, 2015 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyeshammadi/6224607462c3734f1472 to your computer and use it in GitHub Desktop.
Save ilyeshammadi/6224607462c3734f1472 to your computer and use it in GitHub Desktop.
Creation d'une class Etudiant
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