We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5051b85 commit ea6dfe3Copy full SHA for ea6dfe3
bin/com/baidu/PrintAB.class
764 Bytes
src/com/baidu/PrintAB.java
@@ -0,0 +1,36 @@
1
+package com.baidu;
2
+
3
+public class PrintAB {
4
+ public static void main(String[] args) {
5
+ new PrintAB().printAB();
6
+ }
7
8
+ /**
9
+ * 这个解法自己想的有点弱智了!
10
+ */
11
+// public void printAB(){
12
+// if(new PrintAB(){
13
+// boolean www(){
14
+// System.out.print("a");
15
+// return false;
16
+// }
17
+// }.www()){
18
19
+// }else{
20
+// System.out.print("b");
21
22
23
24
25
+ * 借鉴的解法
26
27
+ public void printAB(){
28
+ if(System.out.append("a")==null){
29
+ System.out.print("a");
30
+ }else{
31
+ System.out.print("b");
32
33
34
35
36
+}
0 commit comments