Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit type conversion via static #valueOf method #4

Closed
amelentev opened this issue Nov 17, 2012 · 1 comment
Closed

Implicit type conversion via static #valueOf method #4

amelentev opened this issue Nov 17, 2012 · 1 comment
Assignees
Milestone

Comments

@amelentev
Copy link
Owner

For be able to write

BigInteger a = 123

instead of

BigInteger a = BigInteger.valueOf(123)

Scala equivalent to:

implicit def intToBigInteger(x: Int) = BigInteger.valueOf(x)
@ghost ghost assigned amelentev Nov 17, 2012
@amelentev
Copy link
Owner Author

This is already performed by javac for Integer, Double and other wrapper classes (boxing):

Integer a = 123 

transforms to

Integer a = Integer.valueOf(123)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant