3 ms·
"5" * 2 == "55" You're calling a method on a string, so you got the string doubled. Seems to make sense to me. Obviously in this case the order of the argumen
by biaxident 17y ago
"5" * 2 == "55"
You're calling a method on a string, so you got the string doubled. Seems to make sense to me.
Obviously in this case the order of the arguments matter.
- earthboundkid 17y ago"Obviously in this case the order of the arguments matter." It's not obvious in terms of intuitiveness, no. Why not extend the Integer class to know to call mystring's * method when their order is reversed? That would be intuitive.