M
Michael Satterwhite
As much as I like Ruby, I do miss the polymorphic behavior of routines
in Java and C++. There are frequently times in which it would be useful
to have constructors (or routines) that take different arguments. I do
see some constructors that may take arguments of different types, so I
know people are doing it, but I'm curious as to how.
The only way I can think of is to start the routine with a check such as
"var.class.name == <whatever>" and have different logic within the
routine that is taking different argument types. Would some of you let
me know of your techniques? I'm anxious to learn.
---Michael
in Java and C++. There are frequently times in which it would be useful
to have constructors (or routines) that take different arguments. I do
see some constructors that may take arguments of different types, so I
know people are doing it, but I'm curious as to how.
The only way I can think of is to start the routine with a check such as
"var.class.name == <whatever>" and have different logic within the
routine that is taking different argument types. Would some of you let
me know of your techniques? I'm anxious to learn.
---Michael