-
-
Save MarcinusX/62c3eff48e55e5ac07c9051b1d26d01e 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
int printName(String firstName, [String surname]) { | |
print(firstName); | |
if (surname != null) { | |
print(surname); | |
} | |
} | |
// i wywołamy tę metodę tak: | |
printName('Adam'); | |
// lub tak | |
printName('Adam', 'Nowak'); | |
int printNameTwo(String firstName, {String surname}) { | |
print(firstName); | |
if (surname != null) { | |
print(surname); | |
} | |
} | |
// a tę metodę wywołamy tak: | |
printName('Adam'); | |
// lub tak | |
printName('Adam', surname: 'Nowak'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment