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


How to create arrays in scala?



How to create arrays in scala?..

Answer / Deenanath Ram

In Scala, you can create arrays using the Array() constructor. Here's an example:nn```scalanval myArray = new Array[Int](5)n// Initializing array valuesnmyArray(0) = 1nmyArray(1) = 2nmyArray(2) = 3nmyArray(3) = 4nmyArray(4) = 5n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

How do we implement loops functionally? What is the difference between OOP and FP style loops?

1 Answers  


What is a class in scala?

1 Answers  


What is scala best used for?

1 Answers  


What do you mean by trait in scala and when it is used?

1 Answers  


Is scala better than python?

1 Answers  


Does a Companion object access private members of it’s Companion class in Scala?

1 Answers  


Is Scala an Expression-Based Language or Statement-Based Language? Is Java an Expression-Based Language or Statement-Based Language?

1 Answers  


What are left and right in scala?

1 Answers  


What is listset in scala collection?

1 Answers  


What is a multiline expression in scala?

1 Answers  


How do I append data in a list?

1 Answers  


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

1 Answers  


Categories