Skip to content
Snippets Groups Projects
Commit 8c99ed01 authored by Mahboobe Shakeri's avatar Mahboobe Shakeri
Browse files

commenting hashmap examples

parent 14bc21b8
No related branches found
No related tags found
No related merge requests found
......@@ -4,29 +4,37 @@ import java.util.Scanner;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.HashMap;
import java.io.*;
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.println("changes in the merge");
System.out.println("Hello Class from merge request!");
HashMap<String, Integer> grades = new HashMap<>();
grades.put("Mahboobe", 87);
grades.put("Chris", 86);
System.out.println(grades);
grades.put("Mahboobe", 90);
System.out.println(grades);
for( String name : grades.keySet()){
System.out.println(name + " " + grades.get(name));
}
System.out.println("check if we have Anne grade: " + grades.containsKey("Anne"));
System.out.println("check if we have Mahboobe grade: " + grades.containsKey("Mahboobe"));
System.out.println("check if we have 90 grade: " + grades.containsValue(90));
System.out.println("check if we have Anee grade: " + grades.get("anne"));
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
// System.out.println("changes in the merge");
// System.out.println("Hello Class from merge request!");
//
// HashMap<String, Integer> grades = new HashMap<>();
// grades.put("Mahboobe", 87);
// grades.put("Chris", 86);
//
// System.out.println(grades);
// grades.put("Mahboobe", 90);
// System.out.println(grades);
//
// for( String name : grades.keySet()){
// System.out.println(name + " " + grades.get(name));
// }
// System.out.println("check if we have Anne grade: " + grades.containsKey("Anne"));
// System.out.println("check if we have Mahboobe grade: " + grades.containsKey("Mahboobe"));
// System.out.println("check if we have 90 grade: " + grades.containsValue(90));
//
// System.out.println("check if we have Anee grade: " + grades.get("anne"));
// HashMap<String, String> grades2 = new HashMap<>();
// grades2.put("Mahboobe", "A-");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment