scala - Specify attribute value on constructor -


i´ve been looking this, not find anything.

if have class

class a(a1:int, b1:int,c1:int){} 

i can not create instance specifying 1 of values of constructor in groovy right?.

new a(b1:1) 

you can provide default values class parameters:

// add default values class parameters     class a(a1: int = 0, b1: int = 0, c1: int = 0)  // call constructor passing parameters of choice val = new a(b1 = 1) 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -