public class 变量和常量{
public static void main(String[]args){
int i =myText.getResult(8,16);
System.out.println(i);
myText wk=new myText(5,10);
System.out.println(wk.MAX);
}
}
class myText{
int i;
int j;
final int MAX;
static int m;
myText(int a,int b){
this.i=a;
this.j=b;
int c=getSum(i,j);
this.MAX=999;
System.out.println(c);
}
static int getResult(int a,int b){
m=getDifference(a,b);
return m;
}
int getSum (int a ,int b){
return a+b;
}
static int getDifference(int a ,int b){
if(a>b){
return a-b;
}
else{
return b-a;
}
}
}
常量和变量
最新推荐文章于 2022-10-30 21:56:27 发布