还是对象引用的代码,嘿嘿:
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);
        }
}

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

相关文章:

  • 2021-06-14
  • 2021-12-17
  • 2021-06-25
  • 2022-12-23
  • 2021-08-24
  • 2021-07-30
  • 2022-02-13
猜你喜欢
  • 2022-02-21
  • 2021-12-05
  • 2021-04-17
  • 2021-08-27
  • 2021-11-23
  • 2021-07-23
  • 2021-12-01
相关资源
相似解决方案