Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Last active November 2, 2017 22:06
Show Gist options
  • Save bdkosher/65307b28071fa8c7e467df687abd0a9d to your computer and use it in GitHub Desktop.
Save bdkosher/65307b28071fa8c7e467df687abd0a9d to your computer and use it in GitHub Desktop.
Groovy prints "Double baby", which differs from Java which will print out "Number baby"
void foo(double d) {
println 'Double baby'
}
void foo(Number n) {
println 'Number baby'
}
foo(Double.valueOf(10d))
// Consider blog comparing method dispatch between Java and Groovy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment