Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20231104-KursPodstawowyALX
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
20231104-KursPodstawowyALX
Commits
6688a104
Commit
6688a104
authored
Dec 03, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final
parent
e8a96942
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
Osoba.java
src/main/java/p10_klasy/v4/Osoba.java
+2
-1
Student.java
src/main/java/p10_klasy/v4/Student.java
+1
-1
No files found.
src/main/java/p10_klasy/v4/Osoba.java
View file @
6688a104
...
@@ -17,7 +17,8 @@ public class Osoba {
...
@@ -17,7 +17,8 @@ public class Osoba {
System
.
out
.
println
(
"Nazywam się "
+
imie
+
" "
+
nazwisko
+
" i mam "
+
wiek
+
" lat."
);
System
.
out
.
println
(
"Nazywam się "
+
imie
+
" "
+
nazwisko
+
" i mam "
+
wiek
+
" lat."
);
}
}
boolean
jestPelnoletnia
()
{
// final gwarantuje, że żadna podklasa nie będzie mogła nadpisać tej metody
final
boolean
jestPelnoletnia
()
{
return
wiek
>=
18
;
return
wiek
>=
18
;
}
}
...
...
src/main/java/p10_klasy/v4/Student.java
View file @
6688a104
...
@@ -22,7 +22,7 @@ public class Student extends Osoba {
...
@@ -22,7 +22,7 @@ public class Student extends Osoba {
// przykład: jestPelnoletnia()
// przykład: jestPelnoletnia()
// Taka metoda w nadklasie może być zadeklarowana jako "final" - to znaczy,
// Taka metoda w nadklasie może być zadeklarowana jako "final" - to znaczy,
// że jest to ostateczna definicja i podklasa nie może jeje zmienić
// że jest to ostateczna definicja i podklasa nie może jeje zmienić
// 2) Dodać nowe metody, których nie było w nadklasie
// 2) Dodać nowe metody, których nie było w nadklasie
void
dodajOcene
(
int
ocena
)
{
void
dodajOcene
(
int
ocena
)
{
oceny
.
add
(
ocena
);
oceny
.
add
(
ocena
);
...
...
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