|
Another point that it's useful for which you may want to add, is also with the use of polymorphism, you can a supertype as a constructor, and that makes your life a lot easier so you don't create all the instances as you did in the main method.
and access it as such.Code:private void print(Bandos type){ type.printBelief(); }
Code:print(new Goblins());
Quite basic knowledge, but I do think this should help all the newer people who "learned" Java through rsps.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |