Initialize multiple variables at the same time after a type has already been defined in Java?

后端 未结 3 612
醉话见心
醉话见心 2021-01-28 10:50

Need a little bit of help with syntax here. I\'m trying to re-initialize multiple variables after the type has already been defined. So for example

int bonus, sa         


        
3条回答
  •  忘掉有多难
    2021-01-28 11:47

    int bonus = 25;
    int x = 38; // or any other value you prefer
    int sales = 38;
    

    later you can access the variables

    bonus = 35; // and so on...
    

提交回复
热议问题