标题:这个程序运行显示 无法从静态上下文引用静态 错在哪里
取消只看楼主
天下天下
Rank: 2
等 级:论坛游民
帖 子:62
专家分:15
注 册:2013-10-14
结帖率:66.67%
已结贴  问题点数:20 回复次数:0 
这个程序运行显示 无法从静态上下文引用静态 错在哪里
class person {
   
    public int id;
    public String name;
    public void setid(int id) {this.id = id;}
    public void setname(String name){this.name = name;}
    public String getname(){return name;}
    public int getid(){return id;}
        
    }
   
class puplic extends person {
   
    public String school;
    public String setschool(String school){return school;}
    public String getschool(){return school;}
    public String getinfo() {
        return "id+" +getname() + getid() + school;
   
    }
}
   
    public class jicheng {
        
        public static void main(String agrs[]){
        person w = new person();
        puplic q = new puplic();
        person.setname("dasha");
        person.setid(123456);
        puplic.setschool("lande zhiku");
        System.out.println(puplic.getinfo());
            }
        
        }
搜索更多相关主题的帖子: person public return school 上下文 
2015-07-06 19:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-455123-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.808119 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved