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 Primary Constructor? What is Secondary or Auxiliary Constructor in Scala?



What is Primary Constructor? What is Secondary or Auxiliary Constructor in Scala?..

Answer / Ranjit Maurya

The primary constructor of a class is the one that takes parameters for initializing instance variables. In Scala, if no constructors are explicitly defined, a default primary constructor with no arguments will be automatically generated. A secondary or auxiliary constructor is a constructor that calls another constructor, usually the primary constructor, to initialize an object.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

Mention the types of variables in scala?

1 Answers  


What are the major differences between Scala’s Auxiliary constructors and Java’s constructors?

1 Answers  


What is Scala anonymous function?

1 Answers  


What is the Relationship between equals method and == in Scala? Differentiate Scala’s == and Java’s == Operator?

1 Answers  


What is anonymous (lambda) function in scala?

1 Answers  


Explain what is unit in scala?

1 Answers  


What do you understand by an implicit parameter in scala ?

1 Answers  


What does sortedset in scala collection?

1 Answers  


What is the access modifier in scala?

1 Answers  


What is the difference between 'val' and 'lazy val' in Scala? What is Eager Evaluation? What is Lazy Evaluation?

1 Answers  


Is scala better than java?

1 Answers  


Why is scala faster than java?

1 Answers  


Categories