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



What is the difference between :: and #:: in Scala? What is the difference between ::: and #::: in S..

Answer / Arnab Ghosh

[":: (cons) and #:: (reverse cons) are used for appending elements to lists. The difference is that :: places the element at the head of the list, while #:: places it at the tail. ::: and #::: concatenate two lists with :: and #:: respectively, but they do not reverse the order as their counterparts."]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

Can scala learn without java?

1 Answers  


What is hashset in scala collection?

1 Answers  


What are the different types of Scala literals?

1 Answers  


What is function composition in scala?

1 Answers  


What is flatmap in scala?

1 Answers  


What do you understand by an implicit parameter in scala ?

1 Answers  


Explain any five string methods?

1 Answers  


What are the differences between Case class and Normal Class?

1 Answers  


What is a singleton object in scala?

1 Answers  


What is unit in scala?

1 Answers  


How can you format a string?

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