What is the difference between a statement and an expression in ruby?
Answer / Shivani Goyal
In Ruby, a statement ends with a semicolon (;) or a newline. It performs an action such as assigning a value to a variable or calling a method. An expression also performs an operation but it returns a value. In Ruby, most statements are expressions.
| Is This Answer Correct ? | 0 Yes | 0 No |
How would you freeze an object in ruby? Can you provide a simple example?
How to open a file in Ruby?
Who is the developer of Ruby?
Explain ruby class.
Explain raise statement in Ruby?
Tell me what does ruby name refers to?
What must you do first before you can invoke an unboundmethod object?
What is ruby software and where and when it is usefull.
How will you comment in ruby.
Tell me what is the difference between ruby 1.9 and ruby 2.0?
Tell me how symbol is different from variables?
Are ruby strings are mutable?