From: Calvin Bornhofen Date: 2013-03-08T21:00:50+09:00 Subject: Re: methods in subclasses Hello, On 08.03.2013 09:11, john rxjmo wrote: > No, r180 is not defined in c1, only in the subclass sc1 that's the problem, then. c1 does not know anything about the methods you define on it's subclasses. That's just how OOP goes. Think of it this way: A Dog is an Animal (class Dog inherits from class Animal). Can you make assumptions on what an instance of Dog can do if you have an Animal? The Animal class may define a method "walk" (which is then available in all subclasses), but if it doesn't define a method "bark", how can you call "bark" on an Animal? Inheritance works just one way. (I hope my analogy helped you, if not, I'm sorry if I confused you even more..) To solve your problem you could define @b in your initialize method of c2 as an instance of sc1 (because sc1 has a method r180 while c1 does not). You could also define a method r180 on c1, although that won't give you the behavior you defined in sc1 - at least not if you don't copy r180's source from sc1. Hope I could help! Kind regards, Calvin