So now I'm taking a Java class (mostly because the Uni doesn't offer Python classes.)
import university
class Python:
pass
university.CompSci.add(Python)
No not that kind of class!Well, apparently in Java when you have a function that could just as easily work on int arrays as String arrays as float arrays, you need one copy of that function for each type. Which means in certain situations you have two otherwise identical functions (and I mean character-for-character identical, as in Ctrl-C, Ctrl-V identical, aside from the function signature.
So I'm just staring at this pair of functions now, and I really ought to be wrapping up the assignment, but I can't shake the feeling that this is wrong.
No comments:
Post a Comment