为了账号安全,请及时绑定邮箱和手机立即绑定

麻烦帮忙找一下这段代码中错误

麻烦帮忙找一下这段代码中错误

TryLee 2015-11-13 21:42:18
package day05;//需求:定义类并测试;public class Demo06 {    public static void main(String[] args) {        Student stu1=new Student("张三",88);        stu1.introduce();        Student stu2=new Student();        stu2.setName("李四”);        stu2.setScore(96);        stu2.introduce();    }}class Student{    String name;    int score;    public String getName(){        return name;    }    public void setName(String name){        this.name=name;    }    public int getScore(){        return score;    }    public void setScore(int score){        this.score=score;    }    Student(){        System.out.println("无参的构造方法被执行了!");    }    Student(String name,int score){        this.name=name;        this.score=score;    }    public void introduce(){        System.out.println("大家好,我叫"+name+"我考了"+score+"分!");    }}
查看完整描述

3 回答

?
慕容慕

TA贡献7条经验 获得超1个赞

789行中文符号的问题

查看完整回答
反对 回复 2015-11-14
?
深白

TA贡献5条经验 获得超2个赞

除了中文的“和()这些符号外,我这里运行结果正确。

查看完整回答
反对 回复 2015-11-14
?
erutdioup8556

TA贡献41条经验 获得超27个赞

看不到

查看完整回答
反对 回复 2015-11-13
  • 3 回答
  • 0 关注
  • 1336 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信