Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. package Atelier7;
  2.  
  3. import java.io.Serializable;
  4.  
  5. public class Salarie implements Serializable {
  6.  
  7.     private static final long serialVersionUID = 1234L;
  8.  
  9.     public Salarie(int num, String nom, String service, double salaire) {
  10.         this.NomSalarie = nom;
  11.         this.NumSalarie = num;
  12.         this.NomService = service;
  13.         this.Salaire = salaire;
  14.     }
  15.  
  16.     public Salarie(Salarie s) {
  17.         this.NomSalarie = s.getNomSalarie();
  18.         this.NomService = s.getNomService();
  19.         this.Salaire = s.getSalaire();
  20.         this.NumSalarie = s.getNumSalarie();
  21.     }
  22.  
  23.     public String getNomSalarie() {
  24.         return this.NomSalarie;
  25.     }
  26.  
  27.     public String getNomService() {
  28.         return this.NomService;
  29.     }
  30.  
  31.     public int getNumSalarie() {
  32.         return this.NumSalarie;
  33.     }
  34.  
  35.     public double getSalaire() {
  36.         return this.Salaire;
  37.     }
  38.  
  39.     public void Afficher() {
  40.         System.out.printf("Nom Salarie : %s | Num Salaire : %d | Nom Service : %s | Salaire : %f \n",
  41.                 this.getNomSalarie(), this.getNumSalarie(), this.getNomService(), this.getSalaire());
  42.     }
  43.  
  44.     private int NumSalarie;
  45.     private String NomSalarie;
  46.     private String NomService;
  47.     private double Salaire;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement