Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created October 2, 2019 19:02
Show Gist options
  • Save MarcinusX/e1bb701f51e843aaa3f611d765cb25a1 to your computer and use it in GitHub Desktop.
Save MarcinusX/e1bb701f51e843aaa3f611d765cb25a1 to your computer and use it in GitHub Desktop.
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