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


Explain the difference between function and method in scala?



Explain the difference between function and method in scala?..

Answer / Sudhanshu Karnatak

In Scala, both functions and methods are first-class citizens. However, a method is a member of a class (either a trait or an object), while a function can be standalone. Methods have access to the instance's state, whereas functions don't have any state by default. Functions can be higher-order, meaning they can take other functions as arguments and return them as results.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

Is it a Language or Platform? Does it support OOP or FP?

1 Answers  


What do you understand by tail recursion in scala ?

1 Answers  


Explain how scala is both functional and object-oriented programming language?

1 Answers  


List different types of literals available in scala?

1 Answers  


What does s method in scala string interpolation?

1 Answers  


What are higher-order functions?

1 Answers  


What is the use of ‘???’ in Scala-based Applications?

1 Answers  


What are the available Build Tools to develop Play and Scala based Applications?

1 Answers  


When can you use traits?

1 Answers  


What is a nexted function in scala?

1 Answers  


What is the function parameter with a default value in scala?

1 Answers  


What is the current latest version of scala? What is the major change or update in scala 2.12?

0 Answers  


Categories