S1_JavaPen Text_Finishing.docVIP

  • 72
  • 0
  • 约3.02万字
  • 约 30页
  • 2016-12-03 发布于河南
  • 举报
S1_JavaPen Text_Finishing

S1 Java试题整理在java中,类Animal中的方法printA()定义如下: public void printA() { int a =10; int result=10%3; System.out.println(result); } 在类Dog中方法printA()定义如下class Dog extends Animal {……} Animal animal=new Dog(); animal.printA(); 以上语句输出为(C)。(选择一项) A) 0 B) 3.3333 C) 1 D) 3 在Java编程中,下列(D)语句可用来实现循环结构。(选择一项) A) if…else B) switch C) break D) for 在Java程序里,下列选项中(D)不是关键字。(选择一项) A) Class B) int C) void D) null 下面Java程序段运行后,将()。(选择一项) interface A { int x=0; } class B { int x=1; } class C extends B implements A { public void pX() { System.out.println(x); } public static void main(Stri

文档评论(0)

1亿VIP精品文档

相关文档