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


What is the syntax for function declaration in scala?



What is the syntax for function declaration in scala?..

Answer / Pradeep Kumar Dixit

The basic syntax for a function declaration in Scala is def functionName(parameters): returnType = { /*function body*/ }. For example, def addNumbers(x: Int, y: Int) : Int = x + y.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What is a constructor in scala?

1 Answers  


Is scala easy to learn?

1 Answers  


What is the diamond problem in scala?

1 Answers  


Is scala good for machine learning?

1 Answers  


What are the Java’s OOP constructs not supported by Scala? What are the Scala’s OOP constructs not supported by Java? What are the new OOPs constructs introduced by Scala, but not supported by Java?

1 Answers  


What is the major change or update in Scala 2.12?

1 Answers  


What is the use of ‘yield’ keyword in Scala’s for-comprehension construct?

1 Answers  


Mention Some keywords which are used by Java and not required in Scala? Why Scala does not require them?

1 Answers  


What is flatmap in scala?

1 Answers  


What is the syntax for function declaration in scala?

1 Answers  


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

1 Answers  


Explain recursion through a program?

1 Answers  


Categories