改成这样就行了:
public class jie2{
static void changint(int b){
b=80;
}
static void changperson(Person 某人){
某人.姓名="某某人";
某人.年龄=49;
某人.介绍自己(); } //....
public static void main(String arg[]){
Person 张三=new Person();
张三.姓名="张三";
张三.年龄=30;
System.out.println("下面是张三的自我介绍");
张三.介绍自己(); changperson(张三); System.out.println("下面再请张三作自我介绍");
张三.介绍自己();
int a=500;
System.out.println("调用 changint函数前a="+a); //...
changint(a);
System.out.println("调用 changint函数后a="+a);//...
}
}
作了//...标记的地方是我修改过的。
你的基础没打好。多看入门的书。
public class jie2{
static void changint(int b){
b=80;
}
static void changperson(Person 某人){
某人.姓名="某某人";
某人.年龄=49;
某人.介绍自己(); } //....
public static void main(String arg[]){
Person 张三=new Person();
张三.姓名="张三";
张三.年龄=30;
System.out.println("下面是张三的自我介绍");
张三.介绍自己(); changperson(张三); System.out.println("下面再请张三作自我介绍");
张三.介绍自己();
int a=500;
System.out.println("调用 changint函数前a="+a); //...
changint(a);
System.out.println("调用 changint函数后a="+a);//...
}
}
作了//...标记的地方是我修改过的。
你的基础没打好。多看入门的书。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货