diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-25 23:35:21 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-25 23:35:21 -0600 |
commit | 416e88a071c9d091c3d868171cecb4bdd093b6b6 (patch) | |
tree | 56888efec737d83699b2dbc5818d5a9bef672640 /boil/tests/ex50.java | |
parent | 7e6c63a4d5a4acf9a4f993e6dff6ee7912f26c1e (diff) |
Files I forgot to add
Diffstat (limited to 'boil/tests/ex50.java')
-rw-r--r-- | boil/tests/ex50.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/boil/tests/ex50.java b/boil/tests/ex50.java new file mode 100644 index 0000000..576af0e --- /dev/null +++ b/boil/tests/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 ; + } +} |