You're viewing a comment by serenity and its responses.

serenity Permalink
June 18, 2010, 10:47

"If you made the constructor of A explicit, that would no longer be possible. It's always a good idea to make your constructors explicit to avoid accidental conversions."

Hm. I understood everything else clearly, but this has me stumped. Isn't "55" (without quotes, obviously) an int, which gets passed to a constructor expecting an int?

Comment Responses

June 18, 2010, 10:52

Oops, you're right! I am modifying the example.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type first 3 letters of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.