题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-01-04 07:24:50

[单项选择]阅读下面程序
class Test implements Runnable
 public static void main(String[] args)
  Test t=new Test( );
  t.start( ):
 
 public void run( )

下列关于上述程序的叙述正确的是
A. 程序不能通过编译,因为start()方法在Test类中没有定义
B. 程序编译通过,但运行时出错,提示start()方法没有定义
C. 程序不能通过编译,因为run()方法没有定义方法体
D. 程序编译通过,且运行正常

更多"阅读下面程序 class Test implements Runna"的相关试题:

[单项选择]阅读下面程序
public class Test4
 public static void main(String[] args)
  int 1=10,j=3;
  float m=213.5f,n=4.0f;
  System.out.println(i%j);
  System.out.println(m%n);
 

程序运行的结果是
A. 1.0和1.5
B. 1和1.5
C. 1.0和2.5
D. 1和2.5
[单项选择]阅读下面程序
public class Test3
 public static void main(String[] args)
  int x=3,y=4,z=5;
  String s="xyz":
  System.out.println(s+x+y+z);
 

程序运行的结果是
A. xyz12
B. xyz345
C. xyzxyz
D. 12xyz
[单项选择]阅读下面程序
public class Test2
 public static void main(String[] args)
  int a=10,b=4.c=20,d=6;
   System.out.println(a++*b+c*--d);
 

程序运行的结果是
A. 144
B. 160
C. 140
D. 164
[单项选择]阅读下面代码
public class Test
 public static void main(String avgs[])
  System.out.println(89>>1);
 

其运行结果是
A. 44
B. 45
C. 88
D. 90
[单项选择]阅读下面代码
public class Test2005
 public static void main(String args[])
  System.out.println(~(Oxa5)&Oxa
A. ;
[单项选择]阅读下面代码:
public class Test2005
 public static void main(String args[])
  System.out.println((3>2) 4:5);
 

其运行结果是
A. 2
B. 3
C. 4
D. 5
[单项选择]下面程序的输出为( )。
public class Test
public static void main (String args[])
int x,y;
x=1;
y=2;
System.out.println("The output is"+x+y);


A. The output is xy
B. The output is 3
C. The output is 12
D. The output is x=1 y=2
[单项选择]执行下面程序后输出的正确结果是
public class Test
public static void main(String args[])
System.out.print(100%3);
System.out.print(",");
System.out.print(100%3.0);


A. 1,1
B. 1,1.0
C. 1.0,1
D. 1.0,1.0
[单项选择]阅读下列代码
public class Test2005
public static void main(String args[])
System.out. pfintln(~(0xa5)&0xaa);


其运行结果是( )。
A. 0xa5
B. 10
C. 0x50
D. 0xaa
[单项选择]阅读下面程序
public class Increment
public static void main(stringargs[])
int c;
c=5:
System.out.println(c);
System.out.println(c++);
System.out.println(c);


程序运行结果是( )。
A. 5
B. 5
C. 6
D. 6
[单项选择]下列程序的输出结果是 ( )
public class Test

public static void main(String args[])

System.out.println(100%3);
System.out.println(100%3.0);

A. 1和1
B. 1和10
C. 10和1
D. 10和10
[单项选择]执行下列程序时,会产生什么异常
public class Test
public static void main(String args[])
int d=101;
int b=220;
long a=321;
System.out.println((a-b)/(a-b-d));


A. ArrayIndexOutOfBoundsException
B. NumberFormatException
C. ArithmeticException
D. EOFException
[单项选择]下列语句输出结果为( )。  public class test    public static void main (String args[ ])      int a=23,b=8,c=5;  int e=a%(b%c);   System.out.println(e);     

A. 0
B. 1
C. 2
D. 3
[单项选择]下列语句输出结果为( )。  public class test     public static void main(String args[ ])       int x=10,y=8;    boolean b=true;    System.out.println(x>0&&x<y||b);     

A. true
B. false
C. 1
D. 0
[单项选择]下列语句输出结果为( )。  public class test      public static void main (String args[ ])       int m=20,n=10;    System.out.println((- -m)*(n+ +));     

A. 200
B. 190
C. 209
D. 220
[单项选择]下列代码的执行结果是( )。  public class Test 2  public static void main (String arg[])  System.out.println(100%3);  System.out.println(100%3.0);    

A. 1和1
B. 1和1.0
C. 1.0和1
D. 1.0和1.0
[单项选择]下列代码的执行结果是( )。
public class test4
public smile void main(string args[])
int a=4,b=6,c=8;
String s="abc";
Sy stem.out.println(a+b+s+e);
System.out. pfinfin( );

A. ababcc
B. 464688
C. 46abc8
D. 10abc8
[单项选择]已知有下列类的说明,则下列哪个语句是正确的
public class Test
private float f=1.0f;
int m=12;
static int n=1;
public static void main(String arg[])
Test t= new Test( );


A. f;
B. this. n
C. Test.m;
D. Test.f;
[单项选择]执行下面程序后,结果是   public class Testrr      public static void main(String args[])      int i=0xFFFFFFF1;      int j=-i;      System.out.println("j="+j);       

A. j=-15
B. j=-16
C. j=16
D. j=15

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码