You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(9) |
Oct
(10) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(10) |
Oct
(37) |
Nov
(11) |
Dec
(11) |
2005 |
Jan
(7) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
(13) |
Jul
(10) |
Aug
(1) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
2006 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
From: Peter H.M. J. <p.h...@tb...> - 2004-09-27 09:33:09
|
Dear Hualiang, First of all I'd lile you to use the mailing list as well! I think you have a problem which interest many more. The question is a fundamental one and is luckely for you easy to answer. The entire notion of modularity and encapsulation is that you do not have to see the source code of others. You can simply use these classes. The zip file of these classes is called a library. Instead of keeping them in a zip file, Java normally uses Jar files (=Java archives). This is more or less the same. In eclipse you can do both. * You can add the jar file, or zip file, to your classpath. In eclipse: Right click on the project-->Properties-->Java build path-->Libraries-->Add external Jar. Now select the library. Peter -----Original Message----- From: Lin, H.L [mailto:H....@ST...] Sent: Sunday, September 26, 2004 4:45 PM To: 'p.h...@tb... ' Subject: Question about Java Importance: High hi Peter I have one question about Java. I wanna use some classes programmed by other people. All these classes were already compiled(that means I have no original *.java) and all these classes are compacted in a zip file called Utility.zip. So if I wanna use these class in my own programm. what I'm supposed to do? Kind regards Hualiang Lin |
From: Peter H.M. J. <p.h...@tb...> - 2004-09-27 08:20:19
|
Dear Bram, I have tested the repository extensively and could not reproduce your problem. Could you try to conduct the same action on one of the computers in the SimLab? We can than hopefully find out whether your problem is related to firewall problems on the university network. Kind regards, Peter Ps In the future, please do not send passwords to a public mailing list. Now I have no option but to change the password. You'll get the new one on Wednesday's course. _____ From: dso...@li... [mailto:dso...@li...] On Behalf Of Bram Wesselo Sent: Sunday, September 26, 2004 1:14 PM To: Dsol Subject: [Dsol-java] CVS-toegang Beste groep, Ik heb een probleem: Als ik een CVS check out wil maken, dan krijg ik de volgende error terug: Authentication error: com.jcraft.jsch.JSchException: Session.connect: java.net.ConnectException: Connection timed out: connect ( ... OK?) Met de volgende gegevens heb ik geprobeerd toegang te krijgen: Host: sk-2.tbm.tudelft.nl Repository path: /export/home/spm9322 User: spm9322 Connectiontype: extssh Use default port. Ziet iemand hier een fout? Misschien moet ik een poort openzetten voor m'n firewall, maar als dat zo is, welke dan? Alvast bedankt, Bram Wesselo 06-24222972 Br...@We... |
From: Bram W. <Br...@We...> - 2004-09-26 17:01:02
|
Next time, I will formulate my problems in English... sorry for that. Bram Wesselo 06-24222972 Br...@We... |
From: Bram W. <Br...@We...> - 2004-09-26 11:14:20
|
Beste groep, Ik heb een probleem: Als ik een CVS check out wil maken, dan krijg ik de volgende error terug: Authentication error: com.jcraft.jsch.JSchException: Session.connect: java.net.ConnectException: Connection timed out: connect ( ... OK?) Met de volgende gegevens heb ik geprobeerd toegang te krijgen: Host: sk-2.tbm.tudelft.nl Repository path: /export/home/spm9322 User: spm9322 Password: simlab Connectiontype: extssh Use default port. Ziet iemand hier een fout? Misschien moet ik een poort openzetten voor m'n firewall, maar als dat zo is, welke dan? Alvast bedankt, Bram Wesselo 06-24222972 Br...@We... |
From: Peter H.M. J. <p.h...@tb...> - 2004-09-21 13:39:29
|
Hi Lonneke, First of all I would like you to subscribe yourself to the dsol-java mailing list. This list makes sure everyone in our team understands the problems you face and can learn from your experience. (That's why I reply in English). For those of you not understanding the Dutch message at the bottom of this email: Lonneke's problem is simple: eclipse does not work! Hopefully I can give you some tips. * First of all I would like you to install java. Java is included on the CDROM as well. The file is named j2sdk-1_4_2_05-windows-i586-p.exe and is located in the same directory as eclipse. * After installing Java, please test the installation. Go to START-->RUN-->CMD. No you should see the DOS command line. After typing java -version you should now see something like: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:\Documents and Settings\Peter Jacobs>java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) * If you see something like Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:\Documents and Settings\Peter Jacobs>java 'java' is not recognized as an internal or external command, operable program or batch file. Java is not installed; reboot your computer and try again; if it fails again call me at my mobile number. * Now unzip the eclipse version on the CDROM. Unzip the zip file on your hard disk in and double click on the exlipse.exe. If eclipse gives you any problems, please mail me the error. If it does not work, please do not feel any hesitation to mail me. Peter -----Original Message----- From: Lonneke Reinders [mailto:L.R...@st...] Sent: Tuesday, September 21, 2004 12:48 PM To: p.h...@tb... Subject: Installeren Eclips Hoi Peter, Ik ben de hele ochtend bezig geweest met het installeren van alle software van blackboard, maar hij wil Eclips niet draaien en ik heb geen flauw idee meer waar het aan kan liggen. Het is toch gewoon de bedoeling dat je het download op je harde schijf saved en dan om het programma te runnen je niks hoefde te installeren en alleen dubbelklikken op de Eclipse.exe File? Bij mij geeft hij dan gelijk een foutmelding waar ik zelf niks meer aan kan veranderen. Doe ik iets fout of mis ik een stap? Alvast bedankt, Lonneke -----Oorspronkelijk bericht----- Van: p.h...@tb... [mailto:p.h...@tb...] Verzonden: donderdag 16 september 2004 8:11 Aan: p.h...@tb... Onderwerp: Java introduction course Dear students, First of all I would like you to invite you to the dsol-java mailinglist. This mailinglist enables you to ask any question concerning the Java programming language. Subscription via http://lists.sourceforge.net/mailman/listinfo/dsol-java Secondly you can find the java tutorial at http://java.sun.com/docs/books/tutorial/java/index.html I would like all of you to get hands on experience on this particular tutorial throughout the next week. |
From: R.T.H.Chin <r.t...@tb...> - 2004-05-25 15:06:33
|
For everybody interested in 3D Animation in DSOL, here is a way to set the background (color) of the 3D Animation canves: public class BackGround extends Renderable3D { public BackGround(Location staticLocation, SimulatorInterface simulator) { super(staticLocation, simulator); } protected void provideModel(TransformGroup locationGroup) { Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f); Background bgNode = new Background(bgColor); BoundingSphere bounds = new BoundingSphere(new Point3d(0,0,0), 1000.0); bgNode.setApplicationBounds(bounds); locationGroup.addChild(bgNode); } protected void update(Enumeration children) { // Do nothing } } And create it in constructModel: public void constructModel(SimulatorInterface simulator) throws SimRuntimeException, RemoteException { new BackGround(new Location(0,0,0), simulator); // OTHER STUFF } |
From: <ben...@id...> - 2004-05-25 08:46:22
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Peter J. <p.h...@tb...> - 2003-10-20 16:41:50
|
Hi All, since last august we have been working on a new DSOL release. As many know it always takes some time to update your "old models". In order to show you the benefits of doing so, we have uploaded an "out-of-the-box" demo. 1) Download DSOL : http://www.simulation.tudelft.nl/dsol/dsol.tar.gz 2) unzip all the jars in a directory 3) in this dir, type java -jar dsol-gui.jar Now the DSOLFrame should be visible Open the MM1Queue as follows 4) File->OpenURL-> http://www.simulation.tudelft.nl/dsol/examples/mm1queue.xml 5) Run the model 6) Open the statistics and drag'n drop this to the screen 7) Let us know what you think Peter ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: vanderLaan, O <O.v...@ST...> - 2003-10-16 09:20:33
|
Hi Peter, Where can I find the little "person government" simulation model you developed last friday. Greetings, Olaf |
From: Peter J. <p.h...@tb...> - 2003-10-13 09:55:31
|
Hi all, A final remark on the DSOL CVS Since I don't know how experienced you all are in CVS, I have decided for now to give you only reading rights on the dsol cvs. Please log in as anonymous with the pserver as shown in the attachement Peter On Monday 13 October 2003 10:34, R.T.H.Chin wrote: > Hi Peter, > > I just tried to go to the CVS of sk-2 but but it says "no such file or > directory". Path is "/cvsroot/development", aqnd connection type is > extssh isn't it? > > Regards, > Roy > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > Dsol-java mailing list > Dso...@li... > https://lists.sourceforge.net/lists/listinfo/dsol-java -- ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: Peter J. <p.h...@tb...> - 2003-10-13 09:18:00
|
All, the code provided by Wenlong no longer works!! ! The directory is /export/development/dsol ! Please use either your username / password or the anonymous without password en pserver Peter On Monday 13 October 2003 11:09, Zhao, Wenlong wrote: > hi Roy, > > the host: sk-2.tbm.tudelft.nl > the path: /export/development > the connection type: extssh > > then enter your correct user name and password. it works in my laptop. > > best regards! > > wenlong -- ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: Zhao, W. <w....@tb...> - 2003-10-13 09:09:11
|
aGkgUm95LA0KIA0KdGhlIGhvc3Q6IHNrLTIudGJtLnR1ZGVsZnQubmwNCnRoZSBwYXRoOiAgL2V4 cG9ydC9kZXZlbG9wbWVudA0KdGhlIGNvbm5lY3Rpb24gdHlwZTogZXh0c3NoDQogDQp0aGVuIGVu dGVyIHlvdXIgY29ycmVjdCB1c2VyIG5hbWUgYW5kIHBhc3N3b3JkLiBpdCB3b3JrcyBpbiBteSBs YXB0b3AuDQogDQpiZXN0IHJlZ2FyZHMhDQogDQp3ZW5sb25nDQo= |
From: Peter J. <p.h...@tb...> - 2003-10-13 08:58:05
|
Hi all, because sourceforge is temporarely not able to provide anonymous users to download (IOException) CVS code, DSOL is hosted on a different host. new info: hostname : sk-2.tbm.tudelft.nl directory: /export/development/dsol username: anonymous password : connection type: pserver Peter -- ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: R.T.H.Chin <ro...@tb...> - 2003-10-13 08:34:25
|
Hi Peter, I just tried to go to the CVS of sk-2 but but it says "no such file or directory". Path is "/cvsroot/development", aqnd connection type is extssh isn't it? Regards, Roy |
From: Peter J. <p.h...@tb...> - 2003-10-02 08:14:14
|
Hi Roy, A Test program showing the method invocation is more then enough. I want you all to finish this in order to introduce DSOl in the next course. An event mechanism can be used by the cook to inform the counter whenever he updated the stock. See you all on monday, Peter On Thursday 02 October 2003 09:41, R.T.H.Chin wrote: > Hi Peter, > > Unexpected this is, ... and unfortunate. :-) > > Your statement about "being able to run the model" can not be > interpreted in an entirely unequivocal manner. Do you want the class > definitions to be completed and a test-program that displays method > invocations to work correctly, or do you want discrete simulation by > making use of D-SOL as well? > > Furthermore some of my respected colleagues suggested that there should > also be some implementation using the event-mechanism as you explained > in a previous lecture. However to me it is not obvious why this > mechanism would be applicable in enabling the functionality that you > demand in this implementation. Only an event-mechanism to let the cook > be informed by the stock when the treshold is reached seems a valid > option to me. On the other hand it is unclear to me whether a stock in > reality is capable of informing a cook that is subscribed to it. > > Regards, > Roy > > Jacobs, Peter wrote: > >Hi all, > > > >tommorow I will not be able to give a course. The task for you is to > > complete the McDonalds case. > > > >You must be able to "run the model" and show me that a customer enters the > > restaurant, enters a queue, orders food, pays and leaves. > > > > > >Peter > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > >_______________________________________________ > >Dsol-java mailing list > >Dso...@li... > >https://lists.sourceforge.net/lists/listinfo/dsol-java -- ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: R.T.H.Chin <ro...@tb...> - 2003-10-02 07:41:08
|
Hi Peter, Unexpected this is, ... and unfortunate. :-) Your statement about "being able to run the model" can not be interpreted in an entirely unequivocal manner. Do you want the class definitions to be completed and a test-program that displays method invocations to work correctly, or do you want discrete simulation by making use of D-SOL as well? Furthermore some of my respected colleagues suggested that there should also be some implementation using the event-mechanism as you explained in a previous lecture. However to me it is not obvious why this mechanism would be applicable in enabling the functionality that you demand in this implementation. Only an event-mechanism to let the cook be informed by the stock when the treshold is reached seems a valid option to me. On the other hand it is unclear to me whether a stock in reality is capable of informing a cook that is subscribed to it. Regards, Roy Jacobs, Peter wrote: >Hi all, > >tommorow I will not be able to give a course. The task for you is to complete the McDonalds case. > >You must be able to "run the model" and show me that a customer enters the restaurant, enters a queue, orders food, pays and leaves. > > >Peter > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Dsol-java mailing list >Dso...@li... >https://lists.sourceforge.net/lists/listinfo/dsol-java > > > > |
From: Jacobs, P. <p.h...@tb...> - 2003-10-02 06:58:24
|
Hi all, tommorow I will not be able to give a course. The task for you is to = complete the McDonalds case.=20 You must be able to "run the model" and show me that a customer enters = the restaurant, enters a queue, orders food, pays and leaves. Peter |
From: Jacobs, P. <p.h...@tb...> - 2003-09-28 16:14:24
|
-----Original Message----- From: Chen, Nong Sent: Sun 9/28/2003 3:55 PM To: dso...@li... Cc:=09 Subject: [Dsol-java] [D-Sol] two questions hi everybody, =20 Hi Jessica, I have met two problems for format: 1. how to correct the problem of " line has trailing spaces" ANSWER : simply DELETE the spaces at the end of the line 2. how to generate my own doc/api ( I know when the doc/ api is ready, = just exporting doc/api can get my own java doc. I don't know the way how = to apply doc/api in my class library?) ANSWER : doc/api is just a directory on your fileSystem. Make the = directory either in explorer or with new folder in eclipse. Peter=20 thanks a lot for help! =20 have a nice weekend! |
From: Chen, N. <n....@tb...> - 2003-09-28 16:09:01
|
aGkgZXZlcnlib2R5LA0KIA0KSSBoYXZlIG1ldCB0d28gcHJvYmxlbXMgZm9yIGZvcm1hdDoNCjEu IGhvdyB0byBjb3JyZWN0IHRoZSBwcm9ibGVtIG9mICIgbGluZSBoYXMgdHJhaWxpbmcgc3BhY2Vz Ig0KMi4gaG93IHRvIGdlbmVyYXRlIG15IG93biBkb2MvYXBpICggSSBrbm93IHdoZW4gdGhlIGRv Yy8gYXBpIGlzIHJlYWR5LCBqdXN0IGV4cG9ydGluZyBkb2MvYXBpIGNhbiBnZXQgbXkgb3duIGph dmEgZG9jLiBJIGRvbid0IGtub3cgdGhlIHdheSBob3cgdG8gYXBwbHkgZG9jL2FwaSBpbiBteSBj bGFzcyBsaWJyYXJ5PykNCiANCnRoYW5rcyAgYSBsb3QgZm9yIGhlbHAhDQogDQpoYXZlIGEgbmlj ZSB3ZWVrZW5kIQ0KIA0KSmVzc2ljYQ0K |
From: Peter J. <p.h...@tb...> - 2003-09-26 08:48:18
|
-- ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: Peter J. <p.h...@tb...> - 2003-09-25 08:02:00
|
Collegues, I all expect you to present to me the next step in your McDonald case. I urge you to work on the case; if people don't find the time, they risk lacking behind and not being able to comprehend the material I discuss on fridays. Eventually I will ask them to stop taking the course. Peter ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: Peter J. <p.h...@tb...> - 2003-09-22 10:58:45
|
I think I probably sent you all the wrong xml file. The new xml file is attached. On Monday 22 September 2003 12:10, R.T.H.Chin wrote: > Hi, > > Yan just installed the style checker on eclipse and now everything turns > into one big warning. Is there a way to automatically correct the style? > > Roy > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dsol-java mailing list > Dso...@li... > https://lists.sourceforge.net/lists/listinfo/dsol-java -- ---------------------------------------------------------- Ir. P.H.M. Jacobs, Researcher Delft University of Technology, the Netherlands Faculty of Technology, Policy and Management Systems Engineering Group Jaffalaan 5, 2628 BX Delft, the Netherlands tel. +31 (0)15 2781136 fax. +31 (0)15 2783429 mob. +31 (0)6 51148923 email : p.h...@tb... url : http://www.tbm.tudelft.nl/webstaf/peterja ---------------------------------------------------------- |
From: R.T.H.Chin <ro...@tb...> - 2003-09-22 10:10:59
|
Hi, Yan just installed the style checker on eclipse and now everything turns into one big warning. Is there a way to automatically correct the style? Roy |
From: Jacobs, P. <p.h...@tb...> - 2003-09-20 22:23:54
|
SGkgUm95LA0KIA0KdG8gcG9pbnQgb3V0IGhvdyBKYXZhIHdvcmtzOg0KIA0KKiBBbGwgb2JqZWN0 cyBhcmUgYWxsIHBvaW50ZWQgb3V0IGJ5IGludGVybmFsbHkgdXNpbmcgcG9pbnRlcnMgdG8gdGhl IG1lbW9yeSBsb2NhdGlvbiBvZiB0aGUgb2JqZWN0cy4gDQoqIFByaW1pdGl2ZXMgaW4gSmF2YSBh cmUgbm90IG9iamVjdHMuIFRoZXkgZG8gbm90IGV4dGVuZCBqYXZhLmxhbmcuT2JqZWN0LiBXZSB3 aWxsIGRpc2N1c3MgdGhlIEphdmEgcHJpbWl0aXZlcyBuZXh0IGZyaWRheQ0KIA0KUGV0ZXINCg0K CS0tLS0tT29yc3Byb25rZWxpamsgYmVyaWNodC0tLS0tIA0KCVZhbjogQ2hpbiwgUm95IA0KCVZl cnpvbmRlbjogemEgOS8yMC8yMDAzIDg6MzggDQoJQWFuOiBkc29sLWphdmFAbGlzdHMuc291cmNl Zm9yZ2UubmV0IA0KCUNDOiANCglPbmRlcndlcnA6IFtEc29sLWphdmFdIExpc3RzLCBvYmplY3Rz LCBwb2ludGVycywgYnkgcmVmZXJlbmNlIC0gYnkgdmFsdWUNCgkN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QgZW1haWwgaXMgc3BvbnNvcmVk IGJ5OlRoaW5rR2Vlaw0KCVdlbGNvbWUgdG8gZ2VlayBoZWF2ZW4uDQoJaHR0cDovL3RoaW5rZ2Vl ay5jb20vc2YNCglfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f Xw0KCURzb2wtamF2YSBtYWlsaW5nIGxpc3QNCglEc29sLWphdmFAbGlzdHMuc291cmNlZm9yZ2Uu bmV0DQoJaHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vZHNvbC1q YXZhDQoJDQoJDQoNCg== |
From: R.T.H.Chin <ro...@tb...> - 2003-09-20 18:45:56
|
Hi Peter, Last lecture I asked you about garbage collection and adding objects to a list. You said something like although you're adding a reference you can do as if you actually add the object itself. I think that is not entirely true: what if you add an object to the same list twice? If you then get one of the two additions and modify it then the other reference also refers to the modified object. Of course there will be no reason to add an object to a list twice, but if you do not understand that you are actually adding a reference (pointer) then adding an object twice may seem like copying it. Since many languages treat arguments by value by default, one could quickly get confused. B.t.w. Java treats primitive type - arguments (like int, double) by value and not by reference! Example: public class Test { public void aVoidMethod(int i, JustAClass aClass) { i = 5; aClass.setI(5); } public static void main(String[] args) { Test test = new Test(); int i1 = 10; JustAClass aClass1 = new JustAClass(); aClass1.setI(10); test.aVoidMethod(i1, aClass1); System.out.println(i1); System.out.println(aClass1.getI()); } } public class JustAClass { private int i; public int getI() { return i; } public void setI(int i) { this.i = i; } } Regards, Roy |