| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 507 人关注过本帖
标题:数组赋值有点问题??
取消只看楼主 加入收藏
luyihuaa5201
Rank: 2
等 级:论坛游民
帖 子:254
专家分:10
注 册:2007-3-25
结帖率:66.67%
收藏
 问题点数:0 回复次数:1 
数组赋值有点问题??

package staff;

public class Staff {

private String staId;

private String staName;

private String staSex;

private String staUserName;

private String staPassWord;

public void Staffer(String Id,String Name , String Sex , String UserName ,String PassWord){

staId = Id ;
staName = Name ;
staSex = Sex ;
staUserName =UserName ;
staPassWord = PassWord ;

//Staff staff = new Staff();

System.out.println(staId);

}


public String getStaId() {
return staId;
}

public void setStaId(String staId) {
this.staId = staId;
}

public String getStaname() {
return staName;
}

public void setStaname(String staname) {
this.staName = staname;
}

public String getStaPassWord() {
return staPassWord;
}

public void setStaPassWord(String staPassWord) {
this.staPassWord = staPassWord;
}

public String getStaSex() {
return staSex;
}

public void setStaSex(String staSex) {
this.staSex = staSex;
}

public String getStaUserName() {
return staUserName;
}

public void setStaUserName(String staUserName) {
this.staUserName = staUserName;
}

/**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根

Staff[] staff = new Staff[3];

staff[0] sta=new Staffer();
sta =new String("1000","luyihua","男","zhongguo" ,"123456");

staff[1] sta=new Staff1();
sta =new String("1000","luyihua","男","zhongguo" ,"123456");

staff[2] sta=new Staff1();
sta =new String("1000","luyihua","男","zhongguo" ,"123456");

for(int i = 0 ; i < staff.length ;i ++ ){
System.out.println(staff[i].getStaId());
}
}

}

搜索更多相关主题的帖子: 赋值 
2007-06-03 22:02
luyihuaa5201
Rank: 2
等 级:论坛游民
帖 子:254
专家分:10
注 册:2007-3-25
收藏
得分:0 

像我这样,在构造不初始化的情况下,怎么做呀!!

2007-06-03 22:32
快速回复:数组赋值有点问题??
数据加载中...
 
   



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

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