java学习笔记2:对象的"引用"之二

还是对象引用的代码,嘿嘿:
class Letter{
        
char c;
}

public class PassObject{
        
static void f(Letter y)
        {
                y.c
='z';
        }
        
public static void main(String[] args)
        {
                Letter x
=new Letter();
                x.c
='a';
                System.out.println(
"1: x.c="+x.c);
                f(x);
                System.out.println(
"2: x.c="+x.c);
        }
}

结果是什么呢,"猜"好的就看下面的答案好了
答案

posted @ 2008-03-10 20:10  玉米疯收  阅读(285)  评论(1编辑  收藏  举报