Created
January 16, 2016 20:06
-
-
Save hanawat/741df51519cb75e5008d to your computer and use it in GitHub Desktop.
Overload is possible using the same method name.
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
func user(name: String, hobby: String) { | |
print("My name is \(name). I like \(hobby).") | |
} | |
func user(name: String, hobby: String, greeting: String) { | |
print("My name is \(name). I like \(hobby). \(greeting).") | |
} | |
user("Bob", hobby: "Football") | |
user("Mary", hobby: "Cook", greeting: "Nice to meet you") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment