-
-
Save MarcinusX/e1bb701f51e843aaa3f611d765cb25a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Square { | |
int side; | |
int area() { | |
return side*side; | |
} | |
} | |
// możemy to skrócić do | |
class Square { | |
int side; | |
int area() => side * side; | |
} | |
// a nawet stworzyć getter, który jeszcze bardziej ułatwi dostęp | |
class Square { | |
int side; | |
int get area => side * side; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment