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...


What is Range in Scala? How to create a Range in Scala?



What is Range in Scala? How to create a Range in Scala?..

Answer / Budheshwar Singh

A 'Range' in Scala represents a sequence of integers from a start value, end value (exclusive), and with a step size. To create a range, use the 'to' method on an integer or the 'ranged' method on two integers: val range1 = 1 to 5; val range2 = 0 until 10. Ranges can also be constructed using three arguments with the syntax: val range3 = Range(start, end, step)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

Tell the advantages of companion objects when used in scala?

1 Answers  


Explain different types of identifiers in scala?

1 Answers  


What is the difference between apply and unapply methods in scala?

1 Answers  


Is scala better than java?

1 Answers  


Which IDEs support Play and Scala-Based Applications Development and how?

1 Answers  


How does yield work in scala?

1 Answers  


Explain recursion through a program?

1 Answers  


How do we make a call to a private primary constructor in scala?

1 Answers  


Like Java’s java.lang.Object class, what is the super class of all classes in Scala?

1 Answers  


What are the major differences between Scala’s Auxiliary constructors and Java’s constructors?

1 Answers  


What is a singleton object in scala?

1 Answers  


What is Either in Scala? What are Left and Right in Scala? Explain Either/Left/Right Design Pattern in Scala?

1 Answers  


Categories