+ 3
what is the method addOneTo?
8 Réponses
+ 3
I think it is just showing you that x is used and passed into addoneto but not altered and returned back as x, that is why when printed x is 5 and not 6
+ 2
It can be anything... what the method aim? Were do you use it?
+ 2
It is like function in c/c++,in java we call it method.
+ 2
In c or c++ language function used is main().
similarly
In Java main function is called methods .
+ 2
method addOneTo() is basically here a function like in c/c++, but in java we call them methods .method addOneTo(int name) is assigning the value of x in the method
+ 1
its like same as function in c, c++. but in java its called method.
0
It adds one unit to the parameter passed. if you mean this as the same function in tutorial.
0
but what if u want the incremente value in main method?