• 2022-05-31
    从下面四段(A,B,C,D)代码中选择出正确的代码段
    A: abstract class Name { private String name; public abstract boolean isStupidName(String name) {} }
    B: public class Something { void doSomething () { private String s = ""; int l = s.length(); } }
    C: public class Something { public static void main(String[] args) { Other o = new Other(); new Something().addOne(o); } public void addOne(final Other o) { o.i++; } } class Other { public int i; }
    D: public class Something { public int addOne(final int x) { return ++x; } }
  • 举一反三