Re: (Probably) easy question about inheritance



On Aug 26, 5:55 am, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
On Fri, 24 Aug 2007 18:04:18 -0000,Zerex71<Zere...@xxxxxxx> wrote,
quoted or indirectly quoted someone who said :

Vector class which subclasses from Matrix

Vector has specific meaning (java.util.Vector) already in Java, only
loosely related to its meaning in mathematics. I suggest you call
your new class something else, e.g. Vec so you won't confuse other
programmers.

If Vec extends Matrix then Vec has MORE fields and methods than
Matrix. You might want to think about having Matrix extend Vec.
I am not at all clear what you are trying to do, so take that just as
a possible thing to think about, not a recommendation.
--
Roedy Green Canadian Mind Products
The Java Glossaryhttp://mindprod.com

Roedy,

That's a no-go for me on the Vector suggestion. I'm calling them
Vectors for math purposes because that's what they're called, Java be
damned. It's not meant to be a collection a la the vector class from
the STL. It's a math vector, plain and simple.

Mike

.



Relevant Pages

  • Re: (Probably) easy question about inheritance
    ... Vector has specific meaning already in Java, ... If Vec extends Matrix then Vec has MORE fields and methods than ... The Java Glossary ...
    (comp.lang.java.programmer)
  • Re: Weird Behaviour
    ... > ONE sentence in order to dispute this commonly understood meaning. ... Here's the problem IMO. ... Given this brain-dead method: ... But if java were PBR: ...
    (comp.lang.java.help)
  • Re: Optimise my ray tracer
    ... > I have since ported the program to several other languages, including Java. ... Vec add ... Another optimization is to replace the LinkedList with an ArrayList ... Remember that the Hotspot JVM requires a quite long warmup before ...
    (comp.lang.java.programmer)
  • Re: static class
    ... since at least Java 1.0.2, the initial release more than ten years ago. ... the situation was confused by adding a second meaning. ... Java 1.1 provides the option of declaring nested classes, ... To avoid confusion, they are often called ...
    (comp.lang.java.programmer)
  • Re: unicode
    ... You can't change the meaning of existing code, ... changed the definition in Java 1.8. ... Roedy Green Canadian Mind Products ... the search for a superior moral justification for selfishness. ...
    (comp.lang.java.programmer)