作者H45 (!H45)
看板java
標題Re: 為什麼?!
時間Thu Feb 8 16:02:52 2007
※ 引述《[email protected] (夏傑)》之銘言:
: public class Test{
: public static void main(String args[]){
: Aa obj=new Aa(5);
: System.out.println("Aa= "+obj.i);
: }
: }
: class Aa{
: int i=10;
: public Aa(int i){
: i=i;
^^^^
this.i = i;
: }
: }
: 為什麼obj.i=10
: 而不是等於5呢??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.192.62.227