²æ²æµç×ÓÊé > ÎÄѧµç×ÓÊé > JavaÓïÑÔÈëÃÅ >

µÚ6ÕÂ

JavaÓïÑÔÈëÃÅ-µÚ6ÕÂ

С˵£º JavaÓïÑÔÈëÃÅ ×ÖÊý£º ÿҳ3500×Ö

°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡



ameʱ²Åµ÷ÓÃËü¡£
¡¡¡¡l¹¹Ô캯ÊýMemoÀý×Ó»¹°üº¬ÁËÒ»¸öк¯ÊýMemo£¨£©¡£ÆäʵÕâ¸öÀàÓÐÁ½¸öMemo£¨£©º¯Êý£¡ÈκÎÓëÀàÃûÏàͬµÄº¯Êý¶¼Êǹ¹Ô캯Êý¡£ËüÔÚ´´½¨Ò»¸öжÔÏóʱ±»µ÷Óá£Äã¿ÉÒÔÈÏΪËüÊÇÒ»¸ö¶ÔÏóµÄinit£¨£©³õʼ»¯º¯Êý¡£ÎªÊ²Ã´ÐèÒªÁ½¸ö¹¹Ô캯ÊýÄØ£¿ÓÐÁËÁ½¸ö¹¹Ô캯Êý£¬ÎÒÃÇ¿ÉÒÔÀûÓöà̬ÐÔµÄÓŵ㣬ÓÐÁ½ÖÖ·½·¨´´½¨Ò»¸öÐÂMemo¶ÔÏó¡£ÎÒÃÇ¿ÉÒÔ¼òµ¥µÄ´´½¨Ê¹ÓÃȱʡÐÅÏ¢µÄMemo¶ÔÏó£ºm=newMemo£¨£©£»»òÕߣ¬ÎÒÃÇ¿ÉÒÔ×Ô¼ºÌ᣿copy£»ÐÅÏ¢£ºm=newMemo£¨¡±Ourmessage¡±£©£»Frame¿ØÖƱ¾³ÌÐòµÄ×îºó¹¦ÄÜÊÇÔÚmain£¨£©ÀィÁ¢²¢ÏÔʾframe¡£ËüÓÉÒÔÏÂÁ½²½ÊµÏÖ£º//Step1m=newMemo£¨£©£»//Step2m¡£start£¨£©£»µÚÒ»²½³õʼ»¯memo¶ÔÏó¡£ÎÒÃÇÏó²Ù×÷ÆäËü¶ÔÏóÒ»Ñù²Ù×÷m¡£ÎªÏÔʾframe£¬ÎÒÃÇÐèÒªµ÷ÓÃshow£¨£©¡£ÕâÔÚµÚ¶þ²½ÀïʵÏÖ¡£ÁíÒ»¸öҪעÒâµÄÊdzÌÐòµÄ½¡×³ÐÔ£ºÎÒÃÇ»ù±¾µÄframeÀïûÓаüº¬´¦Àí±ê×¼WINDOW_DESTROYÏûÏ¢µÄº¯Êý¡£ÕâÑù£¬Ä㽫²»ÄÜÔÚ´°¿ÚµÄ¿ØÖƲ˵¥ÀïÑ¡ÖС±Quit¡±»ò¡±Exit¡±¡£ÎªÁËÔö¼ÓÕâ¸ö¹¦ÄÜ£¬ÄãÐèÒªÔö¼ÓÒÔϵĴ¦Àí³ÌÐò£ºpublicbooleanhandleEvent£¨Evente£©£ûif£¨e¡£id==Event¡£WINDOW_DESTROY£©£ûdispose£¨£©£»System¡£exit£¨1£©£»returntrue£»£ýelse£û//Goaheadanddowhatwenormallywouldhavedonereturnsuper¡£handleEvent£¨e£©£»£ý£ý
¡¡¡¡²Ëµ¥Í¼ÐνçÃæÒÀ¿¿²Ëµ¥À´Ö¸µ¼Óû§²Ù×÷¡£Éè¼Æ¶ÀÁ¢µÄJavaÓ¦ÓóÌÐòʱ£¬JavaÌ᣿copy£»´´½¨ºÍʹÓò˵¥µÄÖ±½Ó·½·¨¡£ÏóÆäËü×é¼þÒ»Ñù£¬new½«´´½¨Ò»¸ö²Ëµ¥£ºMenuoptionMenu£»optionsMenu=newMenu£¨¡±Options¡±£©£»²Ëµ¥ÏîÒ»£¿copy£»Äã´´½¨ÁËÒ»¸ö²Ëµ¥£¬Äã¿ÉÒÔʹÓÃadd£¨£©À´×齨²Ëµ¥ÏoptionsMenu¡£add£¨newMenuItem£¨¡±Option1¡±£©£»optionsMenu¡£add£¨newMenuItem£¨¡±Option2¡±£©£»²Ëµ¥Ê¼þµ±ÄãÑ¡ÖÐij¸ö²Ëµ¥Ïîʱ£¬Äã´´½¨´Ë²Ëµ¥ÏîµÄ×Ö·û£¿reg£»½«ÔÚʼþÖзµ»Ø¡£Äã¿ÉÒÔÏó²âÊÔ°´Å¥Ñ¡ÔñÒ»Ñù²âÊԲ˵¥Ñ¡Ôñ£ºpublicbooleanaction£¨Evente£»Objectarg£©£û¡£¡£¡£if£¨e¡£targetinstanceofMenuItem£©£ûSystem¡£out¡£println£¨£¨String£©arg£©£»£ý¡£¡£¡££ýÆäËü²Ëµ¥Ïî³ýÁËÉÏÃæÃèÊöµÄ¼òµ¥²Ëµ¥ÏîÍ⣬Ä㻹¿ÉÔö¼ÓCheckBox²Ëµ¥Ï·Ö¸îÏߣ¬ÒÔ¼°×Ӳ˵¥¡£ÏÂÃæÊÇÒ»£¿copy£»Àý×Ó£ºMenum£»n£»m=newMenu£¨¡±Examples¡±£©£»m¡£add£¨newMenuItem£¨¡±Basic¡±£©£©£»m¡£add£¨newMenuItem£¨¡±Simple¡±£©£©£»
//addaseparatorm¡£add£¨newMenuItem£¨¡±¡­¡±£©£©£»//addaCheckboxitemm¡£add£¨newCheckboxMenuItem£¨¡±Check¡±£©£©£»//addasubmenun=newMenu£¨¡±MoreExamples¡±£©£»n¡£add£¨newMenuItem£¨¡±SubBasic¡±£©£©£»n¡£add£¨newMenuItem£¨¡±SubSimple¡±£©£©£»m¡£add£¨n£©£»²Ëµ¥ÌõÄã´´½¨ºÃ²Ëµ¥ºó£¬ÄãÓ¦½«£¿reg£»·ÅÔÚÓ¦ÓóÌÐòµÄ²Ëµ¥ÌõÉÏ£ºmb=newMenubar£¨£©£»mb¡£add£¨m£©£»mb¡£add£¨optionsMenu£©£»È»ºóÄã¿ÉΪappletÉèÖò˵¥Ìõ£ºsetMenuBar£¨mb£©£»
4¡£5¶ÀÁ¢Ó¦ÓóÌÐòÀý×Ó
¡¡¡¡ÎªÁË¿´Ò»¸ö¸ü¸´ÔӵĶÀÁ¢µÄͼÐνçÃæÓ¦ÓóÌÐò£¬ÏÂÃæÓÐÒ»¸öÊý×Öת»»µÄÀý×Ó£ºimportjava¡£awt¡£*£»
publicclassd2xextendsFrame£ûintdecimalValue=0£»StringbaseXValue
=newString£¨¡±0¡±£©£»TextFielddDisplay£»xDisplay£»
//d2xconstructorpublicd2x£¨£©£ûsuper£¨¡±DecimalConverter¡±£©£»//setthe
titleoftheframeMenuBarmb=newMenuBar£¨£©£»Buttond2Binary=new
Button£¨¡±Binary¡±£©£»Buttond2Octal=newButton£¨¡±Octal¡±£©£»Buttond2Hex=
newButton£¨¡±Hex¡±£©£»Buttond2Base36=newButton£¨¡±Base36¡±£©£»Panelp1=new
Panel£¨£©£»Panelp2=newPanel£¨£©£»Panelp3=newPanel£¨£©£»
//addasimplemenuMenum=newMenu£¨¡±Application¡±£©£»m¡£add£¨new
CheckboxMenuItem£¨¡±Base36Active¡±£©£»m¡£add£¨newMenuItem£¨¡±Exit¡±£©£©£»
//addmenutomenubarmb¡£add£¨m£©£»setMenuBar£¨mb£©£»//installthismenubar
intheframe
//Addbuttonstotheirownpanelp3¡£setLayout£¨newFlowLayout£¨£©£©£»
p3¡£add£¨d2Binary£©£»p3¡£add£¨d2Octal£©£»p3¡£add£¨d2Hex£©£»p3¡£add£¨d2Base36£©£»
//AddtextfieldsLabeldLabel=newLabel£¨¡±EnterDeecimal£º¡±£©£»Label
xLabel=newLabel£¨¡±ConvertedValue£º¡±£©£»dDisplay=new
TextField£¨integer¡£toString£¨decimalValue£©£»7£©£»xDisplay=new
TextField£¨baseXValue£»32£©£»xDisplay¡£setEditable£¨false£©£»
p1¡£setLayout£¨newFlowLayout£¨FlowLayout¡£LEFT£©£©£»p2¡£setLayout£¨new
FlowLayout£¨FlowLayout¡£LEFT£©£©£»p1¡£add£¨dLabel£©£»p1¡£add£¨dDisplay£©£»
p2¡£add£¨xLabel£©£»p2¡£add£¨xDisplay£©£»
//Addthepanelsadd£¨¡±North¡±£»p1£©£»add£¨¡±Center¡±£»p2£©£»
add£¨¡±South¡±£»p3£©£»£ý//endd2xconstructor
publicvoidstart£¨£©£ûresize£¨400£»150£©£»show£¨£©£»£ý
publicvoidupdateXDisplay£¨£©£ûxDisplay¡£setText£¨baseXValue£©£»£ý
publicbooleanhandleEvent£¨Eventevt£©£ûif£¨evt¡£targtintanceofMenuItem£©
£ûif£¨¡±Exit¡±¡£equals£¨£¨£¨MenuItem£©evt¡£target£©¡£getLabel£¨£©£©£©£ûhide£¨£©£»
dispose£¨£©£»System¡£exit£¨0£©£»returnfalse£»£ýretruntrue£»£ýelseif
£¨evt¡£targetinstanceofButton£©£ûStringwhick=
£¨£¨Button£©evt¡£target£©¡£getLabel£¨£©£»if£¨whick¡£equals£¨¡±Binary¡±£©£©
£ûdecimalValue=Integer¡£parseInt£¨dDisplay¡£getText£¨£©£©£»baseXValue=
Interger¡£toString£¨decimalValue£»2£©£»£ýif£¨whick¡£equals£¨¡±Octal¡±£©£©
£ûdecimalValue=Integer¡£parseInt£¨dDisplay¡£getText£¨£©£©£»baseXValue=
Interger¡£toString£¨decimalValue£»8£©£»£ýif£¨whick¡£equals£¨¡±Hex¡±£©£©
£ûdecimalValue=Integer¡£parseInt£¨dDisplay¡£getText£¨£©£©£»baseXValue=
Interger¡£toString£¨decimalValue£»16£©£»£ýif£¨whick¡£equals£¨¡±36¡±£©£©
£ûdecimalValue=Integer¡£parseInt£¨dDisplay¡£getText£¨£©£©£»baseXValue=
Interger¡£toString£¨decimalValue£»36£©£»£ýupdateXDisplay£¨£©£»returntrue£»£ý
returnfalse£»£ý
publicstaticvoidmain£¨Stringargs£§£§£©£ûd2xm=newd2x£¨£©£»m¡£start£¨£©£»£ý£ý
±¾ÕÂС½á£º
¡¡¡¡1¡£javaÓÐÁ½ÖÖÀàÐ͵ÄÓ¦ÓóÌÐò£¬Ò»ÖÖÊÇÖ±½ÓÔËÐÐÔÚjavaÐéÄâ»úÉÏ£¬ÓÃjavaÃüÁîÖ´ÐУ»ÁíÒ»ÖÖÔËÐÐÔÚä¯ÀÀÆ÷ÀÓÉä¯ÀÀÆ÷µ÷ÓÃÖ´ÐУ¬Ò»°ã³ÆËüΪAppletС³ÌÐò¡£±¾ÊéÖ÷ÒªÌÖÂÛµÚÒ»ÖÖÓ¦ÓóÌÐò¡£2¡£javaÓ¦ÓóÌÐòÊÇÓÉÀà×é³ÉµÄ£¬¶øÇÒÓÃjavaÃüÁîÐÐÖ´ÐеÄÀà±ØÐëÓÐmainÈë¿Úº¯Êý¡£3¡£ÓëCÓïÑÔÏàËÆ£¬java³ÌÐòÒ²¿ÉÓÉÃüÁîÐд«µÝ¸ømainº¯Êý²ÎÊý¡£4¡£»ù±¾´°¿Újava³ÌÐòµÄ»ù±¾ÀàÊÇFrame¡£ÀûÓÃËü¿ÉÒԺܷ½±ãµØ½¨Á¢Í¼ÐÎÓû§½çÃæ³ÌÐò¡£
µÚÎåÕÂJavaµÄÀà
ÀàÊÇJavaÓïÑÔÃæÏò¶ÔÏó±à³ÌµÄ»ù±¾ÔªËØ£¬Ëü¶¨ÒåÁËÒ»¸ö¶ÔÏóµÄ½á¹¹ºÍÐÐΪ¡£ÔÚJava³ÌÐòÀÄãÒª±í´ïµÄ¸ÅÄî·â×°ÔÚij¸öÀàÀï¡£Ò»¸öÀඨÒåÁËÒ»¸ö¶ÔÏóµÄ½á¹¹ºÍËüµÄ¹¦Äܽӿڣ¬¹¦ÄܽӿڳÆΪ³ÉÔ±º¯Êý¡£µ±Java³ÌÐòÔËÐÐʱ£¬ÏµÍ³ÓÃÀàµÄ¶¨Òå´´½¨ÀàµÄʵÀý£¬ÀàµÄʵÀýÊÇÕæÕýµÄ¶ÔÏó¡£ÀඨÒåµÄÒ»°ãÐÎʽÈçÏ£º
classclassnameextendssuperclassname£ûtypeinstance¡­variable1£»typeinstance¡­variable2£»¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£typeinstance¡­variableN£»typemethodname1£¨parameter¡­list£©£ûmethod¡­body£»£ýtypemethodname2£¨parameter¡­list£©£ûmethod¡­body£»£ý¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£typemethodnameN£¨parameter¡­list£©£ûmethod¡­body£»£ý£ý
ÕâÀclassnameºÍsuperclassnameÊǺϷ¨µÄ±êʶ·û¡£¹Ø¼ü´ÊextendsÓÃÀ´±íÃ÷classnameÊÇsuperclassnameÅÉÉúµÄ×ÓÀà¡£ÓÐÒ»¸öÀà½Ð×öObject£¬ËüÊÇËùÓÐJavaÀàµÄ¸ù¡£Èç¹ûÄãÏ붨ÒåObjectµÄÖ±½Ó×ÓÀ࣬Äã¿ÉÒÔÊ¡ÂÔextends×Ӿ䣬±àÒëÆ÷»á×Ô¶¯°üº¬Ëü¡£ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÀàµÄ¶¨Òå¡£classUniversity£û£ý
5¡£1¶ÔÏóʵÀý
ÀàÃû¿ÉÒÔ×÷Ϊ±äÁ¿µÄÀàÐÍÀ´Ê¹Óã¬Èç¹ûÒ»¸ö±äÁ¿µÄÀàÐÍÊÇij¸öÀ࣬ÄÇôËü½«Ö¸ÏòÕâ¸öÀàµÄʵÀý£¬³ÆΪ¶ÔÏóʵÀý¡£ËùÓжÔÏóʵÀýºÍËüÃǵÄÀàÐÍ£¨Ä³¸öÀࣿcopy£»µÄ×ÓÀàµÄʵÀý¶¼ÊÇÏàÈݵġ£¾ÍÏó¿ÉÒÔ°ÑbyteÐ͵ÄÖµ¸³¸øintÐ͵ıäÁ¿Ò»Ñù£¬Äã¿ÉÒÔ°ÑObjectµÄ×ÓÀàµÄÈκÎʵÀý¸³¸øÒ»¸öObjectÐ͵ıäÁ¿¡£Ò»¸öʵÀýÊÇÀàÄ£°åµÄµ¥¶ÀµÄ¿½±´£¬´øÓÐ×Ô¼ºµÄ³ÆΪʵÀý±äÁ¿µÄÊý¾Ý¼¯¡£Ã¿¸öʵÀýÒ²¿ÉÒÔ×÷Ϊһ¸ö¶ÔÏó¡£µ±Ä㶨ÒåÒ»¸ö±äÁ¿µÄÀàÐÍÊÇij¸öÀàʱ£¬ËüµÄȱʡֵÊÇnull£¬nullÊÇObjectµÄÒ»¸öʵÀý¡£¶ÔÏónullûÓÐÖµ£¬ËüºÍÕûÊý0²»Í¬¡£ÏÂÃæÕâ¸öÀý×ÓÖУ¬ÉùÃ÷±äÁ¿uµÄÀàÐÍÊÇÀàUniversity¡£Universityu£»ÕâÀ±äÁ¿uµÄÖµÊÇnull¡£
5¡£2ʵÀý±äÁ¿
Javaͨ¹ýÔÚÀඨÒåµÄ´óÀ¨ºÅÀïÉùÃ÷±äÁ¿À´°ÑÊý¾Ý·â×°ÔÚÒ»¸öÀàÀï¡£ÕâÀïµÄ±äÁ¿³ÆΪʵÀý±äÁ¿¡£ÏÂÃæµÄÀý×Ó¶¨ÒåÁËÒ»¸ö½Ð×öUniversityµÄÀ࣬ËüÓÐÁ½¸öʵÀý±äÁ¿£ºnameºÍcity¡£classUniversity£ûStringname£»city£»£ý
5¡£3new²Ù×÷·û
²Ù×÷·ûnewÓÃÀ´Éú³ÉÒ»¸öÀàµÄʵÀý£¬ÏÂÃæÕâ¸öÀý×ÓÉú³ÉÁËÀàUniversityµÄÒ»¸öʵÀý£¬´æ·ÅÔÚ±äÁ¿uÖС£
Universityu=newUniversity£¨£©£»ÔÚ´ËÀýÖУ¬±äÁ¿uÖ¸ÏòÕâ¸ö¶ÔÏ󣬵«²¢²»ÕæÕý°üº¬Õâ¸ö¶ÔÏó¡£Äã¿ÉÒÔÓöà¸ö±äÁ¿Ö¸Ïòͬһ¸ö¶ÔÏó¡£ÏÂÃæµÄÀý×ÓÖУ¬´´½¨ÁËÒ»¸öUniversityµÄ¶ÔÏ󣬵«´´½¨ÁËÁ½¸öÖ¸ÏòËüµÄ±äÁ¿¡£
Universityu=newUniversity£¨£©£»Universityu2=u£»
¶Ôu2ËùÖ¸ÏòµÄ¶ÔÏóµÄÈκθĶ¯¶¼»á¶ÔuËùÖ¸ÏòµÄ¶ÔÏóÆð×÷Óã¬ÒòΪËüÃÇÊÇͬһ¸ö¶ÔÏ󡣶ÔuºÍu2µÄ¸³ÖµÖ»ÊÇ°ÑËüÃÇÖ¸ÏòÕâ¸ö¶ÔÏ󣬼ÈûÓзÖÅäÄڴ棬ҲûÓи´ÖÆÕâ¸ö¶ÔÏóµÄÈκβ¿·Ö¡£¶ÔuµÄÔÙ¸³ÖµÖ»ÊǼòµ¥µØÈ¥µôÁËuºÍÔ­À´¶ÔÏóµÄÁªÏµ£¬²¢²»Ó°Ïì¶ÔÏó±¾Éí£¬ÏÂÃæµÄÀý×Ó˵Ã÷ÁËÕâÖÖÇé¿ö¡£
Universityu=newUniversity£¨£©£»Universityu2=u£»u=null£»
¾¡¹Üu±»¸³ÖµÎªnull£¬u2ÈÔÖ¸ÏòÔ­À´ÓɲÙ×÷·ûnew´´½¨µÄ¶ÔÏó¡£ÔÚÇ°ÃæµÄÀý×ÓÀÎÒÃÇÉú³ÉÁËÒ»¸ö¶ÔÏó²¢ÇÒÖ¸ÏòÁËËüÁ½´Î¡£Õâ¾ÍÔÊÐíÁ½¸ö±äÁ¿¸Ä±äͬһ¸ö¶ÔÏó¡£´´½¨Ò»¸öеĶÔÏóʱ£¬¿ÉÖ±½Ó¶ÔËüµÄʵÀý±äÁ¿¸³Öµ¡£Ã¿¸ö¶ÔÏó¶¼ÓÐËüËùÊôÀàµÄʵÀý±äÁ¿µÄ¿½±´£¬Ã¿¸ö¶ÔÏóµÄʵÀý±äÁ¿¶¼ÊǺÍÆäËû¶ÔÏóµÄʵÀý±äÁ¿·ÖÀëµÄ£¬ËùÒԸıäÒ»¸ö¶ÔÏóµÄʵÀý±äÁ¿²»»áÓ°ÏìÆäËû¶ÔÏóµÄʵÀý±äÁ¿¡£ÏÂÃæµÄÀý×Ó´´½¨ÁËÁ½¸öUniversityµÄ¶ÔÏ󣬲¢¶ÔËüÃÇ·Ö±ð¸³Öµ£ºclassTwoUniversity£ûpublicstaticvoidmain£¨Stringargs£§£§£©£ûUniversityu1=newUniversity£¨£©£»Universityu2=newUniversity£¨£©£»u1¡£name=¡±±±£¿copy£»´óѧ¡±£»u1¡£city=¡±±±£¿copy£»¡±£»u2¡£name=¡±Ç廪´óѧ¡±£»u2¡£city=¡±±±£¿copy£»¡±£»System¡£out¡£println£¨¡±´óѧ£º¡±£«u1¡£name£«¡±³ÇÊУº¡±£«u1¡£city£©£»System¡£out¡£println£¨¡±´óѧ£º¡±£«u2¡£name£«¡±³ÇÊУº¡±£«u2¡£city£©£»£ý£ýÕâ¸öÀý×Ó´´½¨ÁËÁ½¸öUniversityµÄ¶ÔÏ󣬲¢ÇÒ¶ÔËüÃǵÄname¡¢city·Ö±ð¸³Á˲»Í¬µÄÖµ£¬Õâ˵Ã÷ÕâÁ½¸ö¶ÔÏóÊÇÕæÕý·ÖÀëµÄ¡£ÏÂÃæÊǸóÌÐòÔËÐкóµÄÊä³ö½á¹û¡£C£º¡·javaTwoUniversity´óѧ£º±±£¿copy£»´óѧ³ÇÊУº±±£¿copy£»´óѧ£ºÇ廪´óѧ³ÇÊУº±±£¿copy£»
5¡£4µã£¨¡££¿copy£»²Ù×÷·ûµã£¨¡££¿copy£»²Ù×÷·ûÓÃÀ´½ÓÊÕÒ»¸ö¶ÔÏóµÄʵÀý±äÁ¿ºÍ³ÉÔ±º¯Êý¡£ÏÂÃæÊÇÓõã²Ù×÷·ûÀ´½ÓÊÕʵÀý±äÁ¿µÄÒ»°ãÐÎʽ¡£objectreference¡£variablename
ÕâÀïobjectreferenceÊÇÒ»¸ö¶ÔÏóʵÀý£¬variablenameÊÇÕâ¸ö¶ÔÏóÀïÄãÏë½ÓÊÕµÄʵÀý±äÁ¿¡£ÏÂÃæµÄ³ÌÐò¶Î˵Ã÷ÁËÔõÑùÓõã²Ù×÷·ûÀ´¸øʵÀý±äÁ¿¸³Öµ¡£
u¡£name=¡±±±£¿copy£»´óѧ¡±£»u¡£city=¡±±

·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨0£© ²È£¨0£©

Äã¿ÉÄÜϲ»¶µÄ