Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

HW- Ruby 2d array


  • Please log in to reply
1 reply to this topic

#1 Alexxx888


    CC Newcomer

  • Member
  • PipPip
  • 16 posts

Posted 13 October 2012 - 09:10 AM

Hi everyone. I have experience with prog.languges such as C(c++,c#), Java and a little with python. My question is how to create a 2d array in ruby. I`ve searched around but did not found any normal solution... Also i would like to ask a few things like:
1. What does the self. does
2. What does super()
3. What is the purpose of Class exmaple < ex - ( the <ex ?????)

I read about the language , but it seems messy to me even after looking at some examples.
  • 0

#2 dargueta


    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 13 October 2012 - 11:47 AM

2D arrays

self is a pointer to the current object, used in class definitions to call a member function of that class instead of a global function by that same name, or access a member variable instead of creating/reading from/writing to a local variable by that name.

super() invokes a specific class method implemented by that particular class' parent class. For example, if class A has a function named foo(), class B inherits from A and overrides foo(), then class B can use super() to invoke A.foo() instead of B.foo() as would be the default.
  • 1

sudo rm -rf / && echo $'Sanitize your inputs!'

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download