Hi guys,

I am new to ruby i already have an experience in the core php and zend framework.I need to clarify the below doubts,

Is oops in ruby is completely different from other oops concept languages like java,c#.

Can you pls help me out.

Thank you,

Regards,
Premnath

What do you mean by "oops"? I assume the oop part stands for Object Oriented Programming. What does the s stand for?

Anyway object oriented programming in Ruby isn't fundamentally different than in other languages, though obviously the fact that Ruby is dynamically typed and otherwise also very dynamic makes it quite a bit different from C# and Java in general. It's object orientation is also much more inspired by small talk than the languages you mentioned, but that affects the terminology more than anything else. It's also different from Java that every value (including integers) is an object with methods.

The exact semantics of private and protected methods also differ from those in C# and Java. Specifically private in Ruby means that a method can only be called on the current object (and not on other objects of the same class) and protected means that the method can also be called on other objects of the same class (or a subclass). You can always access superclass methods from a subclass even if they're private.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.