Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kurs_java_alx_20240321
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
kurs_java_alx_20240321
Commits
804288b8
Commit
804288b8
authored
Apr 12, 2024
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hakowanie ocen
parent
86c33711
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Program.java
src/p11_klasy/enkapsulacja/Program.java
+8
-4
No files found.
src/p11_klasy/enkapsulacja/Program.java
View file @
804288b8
package
p11_klasy
.
enkapsulacja
;
package
p11_klasy
.
enkapsulacja
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
public
class
Program
{
public
class
Program
{
...
@@ -19,12 +20,15 @@ public class Program {
...
@@ -19,12 +20,15 @@ public class Program {
student
.
dodajOcene
(
3
);
student
.
dodajOcene
(
3
);
student
.
dodajOcene
(
5
);
student
.
dodajOcene
(
5
);
student
.
dodajOcene
(
3
);
student
.
dodajOcene
(
3
);
student
.
dodajOcene
(
5
);
student
.
dodajOcene
(
3
);
student
.
dodajOcene
(
3
);
student
.
dodajOcene
(
4
);
System
.
out
.
println
(
"oceny: "
+
student
.
getOceny
());
System
.
out
.
println
(
"oceny: "
+
student
.
getOceny
());
System
.
out
.
println
(
"średnia: "
+
student
.
sredniaOcen
());
System
.
out
.
println
(
"średnia: "
+
student
.
sredniaOcen
());
// próba modyfikacji listy za pośrednictwem gettera
List
<
Integer
>
lista
=
student
.
getOceny
();
System
.
out
.
println
(
lista
);
lista
.
removeIf
(
x
->
x
<
4
);
// usuń wszystkie oceny gorsze niż 4
System
.
out
.
println
(
lista
);
System
.
out
.
println
(
"średnia: "
+
student
.
sredniaOcen
());
}
}
}
}
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