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 do I append data in a list?



How do I append data in a list?..

Answer / Akshita Mishra

In Scala, you can append data to a List using the :: (cons) operator or the ++ (append) operator. Here's an example:nn```scalanval list1 = List(1, 2, 3)nval newList = list1 :+ 4 // Using the cons operatorn// Ornval newList = list1 ++ List(4) // Using the append operator

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What is a nexted function in scala?

1 Answers  


Explain bitset in scala?

1 Answers  


Is scala an oop?

1 Answers  


Explain any five string methods?

1 Answers  


Which scala library is used for the functional programming?

1 Answers  


Please explain closure is scala?

1 Answers  


Is scala better than python?

1 Answers  


Tell me some features which are supported by Java, but not by Scala and Vice versa?

1 Answers  


What is the difference between :: and #:: in scala?

1 Answers  


What does map in scala collection?

1 Answers  


What does listmap in scala?

1 Answers  


Explain traits in scala.

1 Answers  


Categories