Article View: cn.bbs.comp.lang.java
Article #22976һ���ô��룬��Ұ�æ����
From: ���
Date: Sat, 23 Aug 2003 03:09
Date: Sat, 23 Aug 2003 03:09
44 lines
1864 bytes
1864 bytes
class Location{
int x,y;
}
class Point{
int x,y;
Point()
{
x=20;
y=30;
}
void getXY(int xValue,int yValue)
{
xValue=x;
yValue=y;
}
void getLocation(Location lReference)
{
lReference.x=x;
lReference.y=y;
}
}
public class ArgumentTest {
/** Creates a new instance of ArgumentTest */
public static void main(String args[])
{
Point p=new Point();
System.out.println("Pass by value:");
System.out.println("xValue="+p.xValue+" yValue="+p.yValue);
���������������������������������������������������������������������������
���dz���ʲô�����أ�
Location l=new Location();
p.getLocation(l);
System.out.println("Pass by reference:");
System.out.println("xValue="+l.x+" yValue="+l.y);
}
}
ϣ����ֽ���һ�£���л�ˡ�
--
[m[1;37m�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 202.115.159.102][m
Technical Details
Message-ID:
<47lFK2$9GK@bbs.sjtu.edu.cn>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsgate.cuhk.edu.hk!news.zixia.net!news.neu.edu.cn!SJTUShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB X-Google-Thread: f6cb0,3fe96db6a060a989,start X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2003-08-22 20:08:08 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsgate.cuhk.edu.hk!news.zixia.net!news.neu.edu.cn!SJTU From: yyfsk.bbs@bbs.sjtu.edu.cn (���) Newsgroups: cn.bbs.comp.lang.java Subject: һ���ô��룬��Ұ�æ���� Date: 23 Aug 2003 03:09:02 GMT Organization: ��ˮ˼Դ Message-ID: <47lFK2$9GK@bbs.sjtu.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1061608130.A Lines: 44