Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Classes Part III - Inheritance and Polymorphism
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Thu Dec 14, 2006 9:43 pm   Post subject: (No subject)

That's correct. You cannot have a class inherit from two parent classes. In Turing, our objects are asexual. Ruby is similar, in that it only supports single inheritance, but in Ruby we have mixins. Basically, it allows us to import code from modules into a class. modules in Ruby can have module/class variables/methods as well as instance variables/methods, so importing a module into a class makes sense, unlike in Turing, where classes only have instance variables/methods and modules only have module variables/methods.

I ask you, do you really need to use multiple inheritance?
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 16 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: