From a2d416fdd221883a1ebeac0b0640d425ca8f1eea Mon Sep 17 00:00:00 2001 From: zeekling Date: Sun, 16 May 2021 17:40:32 +0800 Subject: [PATCH] BoolTest --- src/main/java/com/zeekling/exp/BoolTest.java | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/java/com/zeekling/exp/BoolTest.java diff --git a/src/main/java/com/zeekling/exp/BoolTest.java b/src/main/java/com/zeekling/exp/BoolTest.java new file mode 100644 index 0000000..21fc907 --- /dev/null +++ b/src/main/java/com/zeekling/exp/BoolTest.java @@ -0,0 +1,29 @@ +package com.zeekling.exp; + +/** + * @author zeekling + * @apiNote https://www.nowcoder.com/test/question/done?tid=44355378&qid=7672#summary + * @since 2021-05-16 + */ +public class BoolTest { + + private static int j = 0; + + private static Boolean methodB(int k) { + j += k; + return true; + } + + public static void methodA(int i) { + boolean b; + b = i < 10 | methodB(4); + b = i < 10 || methodB(8); + + + } + + public static void main(String args[]) { + methodA(0); + System.out.println(j); + } +}