当前位置: 代码迷 >> Java相关 >> 郁闷 写了好几题都这样 高手教教我
  详细解决方案

郁闷 写了好几题都这样 高手教教我

热度:110   发布时间:2010-09-15 11:44:30.0
郁闷 写了好几题都这样 高手教教我
程序代码:
class student{
    private String name;
    private String school;
    private String age;

    public void setname(String name){
        this.name = name;}
    public void setschool(String school){
        this.school = school;}
    public void setage(String name){
        this.school = school;}
    public void seti(int i){
        this.i = i;}
    public String getname(){
        return name;}
    public String getschool(){
        return school;
        }
    public String getage(){
        return age;
        }

    public void said(String name,String school, String age){
        System.out.println("我的名字叫"+name+"今年"+age+"岁");
        }
      
public class test{
     student a = new student();
   
     a.said(mark,fjnu,five);
     }
    }
   
搜索更多相关的解决方案: public  

----------------解决方案--------------------------------------------------------
都是需要标识符
----------------解决方案--------------------------------------------------------
程序代码:
class Student{
    private String name;
    private String school;
    private String age;

    public void setName(String name){
        this.name = name;}
    public void setSchool(String school){
        this.school = school;}
    public void setAge(String name){
        this.school = school;}

    public String getName(){
        return name;}
    public String getSchool(){
        return school;
        }
    public String getAge(){
        return age;
        }

    public void said(String name,String school, String age){
        System.out.println("我的名字叫"+name+"今年"+age+"岁");
        }
}
public class Test{
    public static void main(String[] args)
    {
     Student a = new Student();
   
     a.said("mark","fjnu","five");
   
    }
}

----------------解决方案--------------------------------------------------------
你的程序没有main, 如何运行呢
----------------解决方案--------------------------------------------------------
回复 4楼 lampeter123
介个介个……

----------------解决方案--------------------------------------------------------
回复 4楼 lampeter123
书看了    刚刚开始联系自己写    经常会忘记
----------------解决方案--------------------------------------------------------
那个也得养成良好的编程风格,格式的注意下!!
----------------解决方案--------------------------------------------------------
提示: 作者被禁止或删除 内容自动屏蔽
2010-09-16 11:55:16
llooppzhang

来 自:江苏
等 级:黑侠
威 望:5
帖 子:308
专家分:518
注 册:2009-10-18
  得分:0 
良好的编程风格很重要哦
----------------解决方案--------------------------------------------------------
回复 8楼 zybjava
Nice Package、
----------------解决方案--------------------------------------------------------
  相关解决方案