Search:

Type: Posts; User: jrahhali

Search: Search took 0.42 seconds.

  1. Is it OK to have a superclass just to hold variables common to their subclasses?

    I have two classes that have no methods:



    Weapon
    ----------
    String name
    int cost
    int requiredStrength
    int requiredDexterity
  2. Re: How would you design the relationship between these two classes?

    What you said makes sense. Thanks a lot for the help, copeg.
  3. Re: How would you design the relationship between these two classes?

    @copeg. So you think that the best solution would be to instantiate an object of Baby within Adult to get code re-use? I think your reasoning that there is a child inside us all is creative. IMO,...
  4. How would you design the relationship between these two classes?

    Say you had these two classes:


    public class Adult {
    public void crawl() {...}
    public void walk() {...}
    public void run() {...}
    }

    public class Baby {
Results 1 to 4 of 4