forked from LaureStrumfeld/ProjetJava-ING3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNiveau.java
More file actions
36 lines (30 loc) · 878 Bytes
/
Niveau.java
File metadata and controls
36 lines (30 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modele;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
*
* @author Isabelle
*/
public class Niveau {
Map <Integer,String> nv=new HashMap<>();
public void add_niveau(String titre){
int id=nv.size();
nv.put(id,titre);
}
public void display(){
if(nv.isEmpty()) {
System.out.println("Nothing to show");}
else{
Iterator iterator =nv.entrySet().iterator();
while(iterator.hasNext()){
Map.Entry nventry=(Map.Entry) iterator.next();
System.out.println("Index: "+nventry.getKey()+" Classe :"+nventry.getValue());
} }
}
}