• 2022-06-05 问题

    以下代码的输出结果是【】。food_counter = 0def addone(food):if food in food_counter:food_counter[food] += 1else:food_counter[food] = 1addone('egg')addone('milk')addone('egg')print(food_counter) A: {'egg':1, 'milk':1, 'egg':1} B: {'egg':1, 'milk':1} C: {'egg':2, 'milk':1} D: {'egg':2, 'milk':1, 'egg':1}

    以下代码的输出结果是【】。food_counter = 0def addone(food):if food in food_counter:food_counter[food] += 1else:food_counter[food] = 1addone('egg')addone('milk')addone('egg')print(food_counter) A: {'egg':1, 'milk':1, 'egg':1} B: {'egg':1, 'milk':1} C: {'egg':2, 'milk':1} D: {'egg':2, 'milk':1, 'egg':1}

  • 2021-04-14 问题

    智慧职教: 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; }

    智慧职教: 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; }

  • 2022-05-31 问题

    从下面四段代码中选择出正确的代码段() A: 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;} B: public class Something {void doSomething () {private String s = ̶”;int l = s.length();}} C: abstract class Name {private String name;public abstract boolean isStupidName(String name) {}} D: public class Something {public int addOne(final int x) {return ++x; }}

    从下面四段代码中选择出正确的代码段() A: 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;} B: public class Something {void doSomething () {private String s = ̶”;int l = s.length();}} C: abstract class Name {private String name;public abstract boolean isStupidName(String name) {}} D: public class Something {public int addOne(final int x) {return ++x; }}

  • 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; } }

    从下面四段(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; } }

  • 2022-05-31 问题

    从下面四段()代码中选择出正确的代码段() A: abstractclassName{privateStringname;publicabstractbooleanisStupidName(Stringname){}} B: publicclassSomething{voiddoSomething(){privateStrings="";intl=s.length();}} C: publicclassSomething{publicstaticvoidmain(String[]args){Othero=newOther();newSomething().addOne(o);}publicvoidaddOne(finalOthero){o.i++;}}classOther{publicinti;} D: publicclassSomething{publicintaddOne(finalintx){return++x;}}

    从下面四段()代码中选择出正确的代码段() A: abstractclassName{privateStringname;publicabstractbooleanisStupidName(Stringname){}} B: publicclassSomething{voiddoSomething(){privateStrings="";intl=s.length();}} C: publicclassSomething{publicstaticvoidmain(String[]args){Othero=newOther();newSomething().addOne(o);}publicvoidaddOne(finalOthero){o.i++;}}classOther{publicinti;} D: publicclassSomething{publicintaddOne(finalintx){return++x;}}

  • 1