Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain case statement in Ruby?



Explain case statement in Ruby?..

Answer / Mohd Wamick

The case statement in Ruby is similar to the switch statement in other programming languages. It allows you to execute different blocks of code based on the value of an expression. The basic structure is as follows:n```rubyncase expressionnwhen value1n # code block for when the expression matches value1nwhen value2n # code block for when the expression matches value2n...nelse n # code block for all other casesnend``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Explain when self.up and self.down method is used?

1 Answers  


what is the Notation used for denoting class variables in Ruby?

1 Answers  


Name different methods for io console in ruby?

1 Answers  


What is the scope of a local variable in ruby?

1 Answers  


How to create a new time instance in Ruby?

1 Answers  


what is the difference between a single quote and double quote?

1 Answers  


Name some operators used in ruby.

1 Answers  


Explain the difference between nil and false in ruby?

1 Answers  


Explain about ruby code blocks?

1 Answers  


How is visibility of methods changed in ruby?

1 Answers  


How to check whether a directory exist or not in Ruby?

1 Answers  


How is object methods defined in ruby?

1 Answers  


Categories