题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-25 19:10:26

[单项选择]

阅读下列代码
public class Test{
String s="One World One Dream";
public static void main(String args[]){
System. out. println(s);
}
}
其运行结果是()


A. args
B. One World One Dream
C. s
D. 编译时出错

更多"阅读下列代码 public class Test{ String s="的相关试题:

[单项选择] package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()
A. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target
[单项选择] public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()
A. Compilation fails.
B. An exception is thrown at runtime.
C. doStuff x=6 main x=6
D. doStuff x=5 main x=5
E. doStuff x=5 main x=6
F. doStuff x=6 main x=5
[单项选择] 1.public classA{ 2.public String doit(intx,inty){ 3.return"a"; 4.} 5. 6.public String doit(int...vals){ 7.return"b"; 8.} 9.} And: 25.A a=new A(); 26.System.out.println(a.doit(4,5)); What is the result?()
A. Line 26 prints "a" to System.out.
B. Line 26 prints "b" to System.out.
C. An exception is thrown at line 26 at runtime.
D. Compilation of class A will fail due to an error in line 6.
[单项选择]语句public String getEncoding( )的功能是( )。
A. 给当前输入流重做标记
B. 获得当前字符流所用的编码方式
C. 基于字节流in生成一个输入字符流对象
D. 给当前字符输入流设置编码方式
[单项选择]文件操作中,语句public String getPath( )的作用是( )。
A. 得到文件对象的父路径名
B. 得到文件的上一级目录名
C. 得到一个包含路径的文件名
D. 得到文件路径名字符串
[单项选择]给页面中第一个span添加一个class,";testSpan";,以下代码正确的是()。
A. $("span").first().addClass("testSpan")
B. $("span").eq(1).addClass("testSpan")
C. $("span").first().css("testSpan")
D. $("span").last().hasClass("testSpan")
[单项选择]阅读下面代码 class Test implements Runnable {  public int run( ) {   int i=0;   while(true) {    i++;    System.out.println("i="+i);   }  } } 上述代码的编译结果是
A. 程序通过编译,并且run()方法可以正常输出递增的i值
B. 程序通过编译,调用run()方法将不显示任何输出
C. 程序不能通过编译,因为while的循环控制条件不能为true
D. 程序不能通过编译,因为run()方法的返回值类型不是void
[单项选择]阅读下面程序 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. 程序编译通过,且运行正常
[单项选择]阅读下列代码 public class Test{ public static void main(String args[]){ System.out.println(89>>1); } } 其运行结果是【 】
A. 44
B. 45
C. 88
D. 90
[单项选择] public static void test(String str) { int check = 4;  if (check = str.length()) {  System.out.print(str.charAt(check -= 1) +“, “);  } else {  System.out.print(str.charAt(0) + “, “);  }  }  and the invocation:  test(”four”);  test(”tee”); test(”to”);  What is the result?() 
A.  r, t, t,
B.  r, e, o,
C.  Compilation fails.
D.  An exception is thrown at runtime.
[单项选择]

阅读下面程序
class Test implements Runnable {
public static void main(String[] args) {
Test t = new Test( );
t.startO;
}
public void run( ){ }
}
下列关于上述程序的叙述正确的是()


A. 程序不能通过编译,因为start()方法在Test类中没有定义
B. 程序编译通过,但运行时出错,提示start()方法没有定义
C. 程序不能通过编译,因为run()方法没有定义方法体
D. 程序编译通过,且运行正常
[单项选择]阅读下列代码 public class Test 2005{ public static void main(String args[]){ System.out.println(~(0xa5)&0xaA) ; } } 其运行结果是【 】
A. 0xa5
B. 10
C. 0x50
D. 0xaa

我来回答:

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

订单号:

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