单项选择题

下列程序段的输出结果是( )。
intdata=0;
chark='a',p='f'
data=p-k;
System.out.printlln(data);

A.0
B.a
C.f
D.5
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序段的输出结果为 public class Test int a,b; Test() a=100; b=200; Test(int x,int y) a=x; b=y; public static void main(String args[]) Test Objl=new Test(12,45); System.out.println( a= +objl.a+ b= +Objl.b); Test Obj2=new Test(); System.out.println( a= +Obj2.a+ b= +Obj2.b); A) a=100 b=200 a=12 b=45 B) a=12 b=45 a=100 b=200C) a=12 b=200 a=100 b=45 D) a=100 b=45 a=12 b=200
单项选择题
下面程序段的输出结果为 package test; public class Class A int x=20; static int y=6; public static void main(String args[]) Class B b=new Class B(); b.go(10); System.out.println( x +b.x); class ClassB int x; void go(int y) ClassA a=new ClassA(); x=a.y;
A) x=10
B) x-20
C) x=6
D) 编译不通过
相关试题
  • JDBC是Java程序与______连接的一种机...
  • 标识符是以 ______ 、下划线(__...
  • 字符输入流的父类是______,字符输出...
  • 稳定的排序算法有______、_____...
  • 线程生命周期有几种状态,分别是创建状态、...