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

How to install scala? Explain

1 Answers  


How is the scala code compiled?

1 Answers  


What is bitset in scala?

1 Answers  


What is a higher-order function in scala?

1 Answers  


Explain the scala anonymous function.

1 Answers  


What are implicit parameters in Scala?

1 Answers  


Can scala learn without java?

1 Answers  


What is the main design decision about two separate keywords: class and object in Scala? How do we define Instance members and Static members in Scala?

1 Answers  


Is scala easy to learn?

1 Answers  


What is a stream in scala?

1 Answers  


What is a companion object in scala?

1 Answers  


What is REPL in Scala? What is the use of Scala’s REPL? How to access Scala REPL from CMD Prompt?

1 Answers  


Categories