Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jvstd1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
jvstd1
Commits
8d650a74
Commit
8d650a74
authored
Sep 30, 2024
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forEach
parent
0de398d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
P2_Lista.java
src/main/java/p10_zbieranie_danych/P2_Lista.java
+5
-0
P5_Slownik.java
src/main/java/p10_zbieranie_danych/P5_Slownik.java
+6
-0
No files found.
src/main/java/p10_zbieranie_danych/P2_Lista.java
View file @
8d650a74
...
...
@@ -34,6 +34,11 @@ public class P2_Lista {
System
.
out
.
print
(
imie
.
toUpperCase
()
+
" "
);
}
System
.
out
.
println
();
// Od Java 8 można forEach z wyrażeniem lambda
lista
.
forEach
(
imie
->
System
.
out
.
print
(
imie
+
"; "
));
System
.
out
.
println
();
System
.
out
.
println
();
System
.
out
.
println
(
"Podawaj numer pozycji, a zakończ pisząc -1"
);
...
...
src/main/java/p10_zbieranie_danych/P5_Slownik.java
View file @
8d650a74
...
...
@@ -31,6 +31,12 @@ public class P5_Slownik {
System
.
out
.
print
(
entry
.
getKey
().
toUpperCase
()
+
"-"
+
entry
.
getValue
()
+
", "
);
}
System
.
out
.
println
();
// Od Java 8 można też w ten sposób przejrzeć cały słownika:
slownik
.
forEach
((
klucz
,
wartosc
)
->
{
System
.
out
.
print
(
klucz
+
"="
+
wartosc
+
"; "
);
});
System
.
out
.
println
();
System
.
out
.
println
();
System
.
out
.
println
(
"Podawaj imiona osób, a ja odczytam ich wiek. Zakończ wciskając enter."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment