Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tutoria_Examples_T03
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mahboobe Shakeri
Tutoria_Examples_T03
Commits
8c99ed01
Commit
8c99ed01
authored
5 months ago
by
Mahboobe Shakeri
Browse files
Options
Downloads
Patches
Plain Diff
commenting hashmap examples
parent
14bc21b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Main.java
+25
-17
25 additions, 17 deletions
src/Main.java
with
25 additions
and
17 deletions
src/Main.java
+
25
−
17
View file @
8c99ed01
...
...
@@ -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-");
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment