| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 619 人关注过本帖
标题:客户端代码 传数值
只看楼主 加入收藏
xyaabbq
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-2
结帖率:0
收藏
 问题点数:0 回复次数:2 
客户端代码 传数值
服务端代码:
package voluntee.Attendance.System.EJ;

public class DataVolunteeAttendanceSystemEJ {
 private int memberId;

 public int getMemberId() {
  return memberId;
 }

 public void setMemberId(int memberId) {
  this.memberId = memberId;
 }
}

....................................................................................................................
我想把memberId 值变成12345  然后在荧幕打印出来, 客户端代码要怎麼写?
(最好给个完整的)
搜索更多相关主题的帖子: return 服务端 客户端 
2011-04-05 14:13
xyaabbq
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-2
收藏
得分:0 
有人建议我这样:
public static void main(String[] args) {  
    DataVolunteeAttendanceSystemEJ dvas = new DataVolunteeAttendanceSystemEJ();  
dvas.setMemberId(12345);  
    System.out.println(dvas.getMemberId());  
}


不过有报错,eclipse建议我改成
DataVolunteeAttendanceSystemEJStub dvas = new DataVolunteeAttendanceSystemEJStub();

改完后dvas.setMemberId(12345);也报错了

我客户端有2个class
DataVolunteeAttendanceSystemEJCallbackHandler

DataVolunteeAttendanceSystemEJStub
不知有什么用?
有人给点意见吗?
2011-04-05 20:29
HarrisonWang
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:16
专家分:155
注 册:2011-4-7
收藏
得分:0 
楼主你引错类了。。。。。。
程序代码:
public static void main(String[] args) { 

    DataVolunteeAttendanceSystemEJ dvas = new DataVolunteeAttendanceSystemEJ(); 

dvas.setMemberId(12345); 

    System.out.println(dvas.getMemberId()); 

}
这段代码哪里有错?
2011-04-07 22:45
快速回复:客户端代码 传数值
数据加载中...
 
   



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

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