How Java handles arguments of a class type.
=====suppose such a method:
public static void openFile(String fileName, PrintWriter stream) throws FileNotFoundException
{
stream = new PrintWriter(fileName);
}
=====then we want to use it this way:
PrintWriter toFile = null;
try
{
openFile("data.txt", toFile);
}
*****After this code is executed, the value of toFile is still null. The file that was opened in the method openFile went away when the method ended. The problem has to do with how Java handles arguments of a class type.
"These arguments are passed to the method as memory addresses that cannot be changed. The state of the object at the memory address normally can be changed, but the memory address itself cannot be changed"!
Ïà¹ØÎĵµ£º
а²×°ÁË JDK 6 µÄ³ÌÐòÔ±ÃÇÒ²Ðí»á·¢ÏÖ£¬³ýÁË´«Í³µÄ bin¡¢jre µÈĿ¼£¬JDK 6 ÐÂÔöÁËÒ»¸öÃûΪ db µÄĿ¼¡£Õâ±ãÊÇ Java 6 µÄгÉÔ±£ºJava DB¡£ÕâÊÇÒ»¸ö´¿ Java ʵÏÖ¡¢¿ªÔ´µÄÊý¾Ý¿â¹ÜÀíϵͳ£¨DBMS£©£¬Ô´ÓÚ Apache Èí¼þ»ù½ð»á£¨ASF£©ÃûϵÄÏîÄ¿ Derby¡£ËüÖ»ÓÐ 2MB ´óС£¬¶Ô±È¶¯éüÉÏ G µÄÊý¾Ý¿âÀ´Ëµ¿ÉνÐäÕä¡£µ«Õâ²¢²»·Á° Derby ......
Abstract
ÔÚ¿ª·¢ÖУ¬Èç¹ûij¸öʵÀýµÄ´´½¨ÐèÒªÏûºÄºÜ¶àϵͳ×ÊÔ´£¬ÄÇôÎÒÃÇͨ³£»áʹÓöèÐÔ¼ÓÔØ»úÖÆ£¬Ò²¾ÍÊÇ˵ֻÓе±Ê¹Óõ½Õâ¸öʵÀýµÄʱºò²Å»á´´½¨Õâ¸öʵÀý£¬Õâ¸öºÃ´¦ÔÚ
µ¥ÀýģʽÖеõ½Á˹㷺ӦÓá£Õâ¸ö»úÖÆÔÚsingle-threaded»·¾³ÏµÄʵÏַdz£¼òµ¥£¬È»¶øÔÚmulti-threaded» ......
ÔÌû¼°ÌÖÂÛ£ºhttp://bbs.bc-cn.net/dispbbs.asp?boardid=12&id=140292
* ×î½üÒòΪ¿ª·¢»î¶¯ÐèÒª,ÓÃÉÏÁËEclipse,²¢ÒªÇóʹÓþ«¼ò°æµÄSQLÊý¾Ý¿â(¼´SQL Server 2005)À´½øÐпª·¢ÏîÄ¿ *
1.×¼±¸¹¤×÷: ×¼±¸Ïà¹ØµÄÈí¼þ(Eclipse³ýÍâ,¿ªÔ´Èí¼þ¿ÉÒÔ´Ó¹ÙÍøÏÂÔØ)
<1> .Microsoft   ......