From 196c279286a2561038089d86c55d7bd9f5a27733 Mon Sep 17 00:00:00 2001 From: Xun Yang <x299yang@uwaterloo.ca> Date: Sun, 12 Apr 2020 11:54:04 -0400 Subject: [PATCH] compID assign test --- Tests/A5/J1_01_compID_param.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/A5/J1_01_compID_param.java diff --git a/Tests/A5/J1_01_compID_param.java b/Tests/A5/J1_01_compID_param.java new file mode 100644 index 0000000..934115a --- /dev/null +++ b/Tests/A5/J1_01_compID_param.java @@ -0,0 +1,19 @@ +public class J1_01_compID_param { + + public J1_01_compID_param() { + j = 5; + } + public int i = 4; + public int j = 1; + public static int n = 10; + + public int m(J1_01_compID_param p){ + p.i = p.i + 2; + return j + p.i; + } + + public static int test() { + J1_01_compID_param k = new J1_01_compID_param(); + return k.i + k.m(k) + J1_01_compID_param.n; + } +} -- GitLab