Time:10-09
CodePudding user response:
Quote: refer to 1st floor timesong wind xiao xi response: Write behind or in front of the return0
Public static void main (String [] args) {Test t=new Test(); //call member method output System. The out. Println (t.m emberMthod ()); } Public int memberMthod () {Int r=0; for (int i=1; I & lt;=100; I++) {R +=I; } return r; }
Quote: reference 3 floor biao. T reply: Quote: refer to 1st floor timesong wind xiao xi response: Write behind or in front of the return0 This is just a example, you want to return is all 1 to 100 Public static void main (String [] args) {Test t=new Test(); //call member method output System. The out. Println (t.m emberMthod ()); } Public int memberMthod () {Int r=0; for (int i=1; I & lt;=100; I++) {R +=I; } return r; }
Page link:https//www.codepudding.com/Backend/58764.html