Commit 6688a104 by Patryk Czarnik

final

parent e8a96942
...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment