diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-26 15:50:38 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-26 15:50:38 -0600 |
commit | 1851f5e76018ec1df3b55dce6cc9a64c9497bf7a (patch) | |
tree | 30f629f7b137a494d4202487f4e22df2d9456481 /base/ex50.java | |
parent | 012298517078170762112abe2654dc69b2f146e1 (diff) |
Rearrange directory structure
Diffstat (limited to 'base/ex50.java')
-rw-r--r-- | base/ex50.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/base/ex50.java b/base/ex50.java new file mode 100644 index 0000000..576af0e --- /dev/null +++ b/base/ex50.java @@ -0,0 +1,35 @@ +class ex50 { + public static void main(String[] z) { + int result ; + A a ; + a = new A() ; + System.out.println(a.set_get()) ; + } +} + +class A { + + B b ; + + public int set_get() { + int r ; + b = new B() ; + r = b.set() ; + r = b.get() ; + return r ; + } +} + +class B { + + int x ; + + public int get() { + return x ; + } + + public int set() { + x = 12 ; + return 1 ; + } +} |