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

What does raw method in scala string interpolation?

1 Answers  


What is auxiliary constructor in scala?

1 Answers  


What is ‘scala trait’ in scala?

1 Answers  


What is recursion tail in scala?

1 Answers  


Give some examples of packages in scala?

1 Answers  


What is the result of x+y*z and why?

1 Answers  


What is the breakable method in scala?

1 Answers  


Why is scala faster than java? Explain

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 is list in scala collection?

1 Answers  


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

1 Answers  


What do you mean by scala map?

1 Answers  


Categories