Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Java is about to get templates, like C++.
- From: ara_e@xxxxxxxxxxxxxxx (Ara Abrahamian)
- Subject: Java is about to get templates, like C++.
- Date: Sun, 27 Sep 1998 23:22:55 +0330
hi! Personally I hate operator overloading! But I think it's really needed for numerical purposes. I think a wise decision would be to define a Numerical interface so that only classes implementing Numerical can be multiplied by other classes implementing Numerical and nothing else. And int, double, etc considered Numericals. This way you'll have a singnature that class X may have overloaded some operator and you won't be confused! What do you think? Ara Abrahamian bi! > Complex x = new Complex( a1, b1); > Complex y = new Complex( a2, b2); > Complex z = x * y; > > ... is far more preferable to this: > > Complex x = new Complex( a1, b1); > Complex y = new Complex( a2, b2); > Complex z = x.mult(y); --- To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- Prev by Date: classloader and serialization in JDK1.2
- Next by Date: Java is about to get templates, like C++.
- Previous by thread: classloader and serialization in JDK1.2
- Next by thread: Java is about to get templates, like C++.
- Index(es):