题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-11 18:12:47

[单项选择]执行下列程序之后,变量n的值为______。
public class Test
public static void main(String[] args)
int y=2;
int z=3;
int n=4;
n=n+-y*z/n;
System.out.println(n);


A. 3
B. -1
C. -12
D. -3

更多"执行下列程序之后,变量n的值为______。 public clas"的相关试题:

[单项选择]执行下列程序段这后,变量n的值为______。
public class Test8

public static void main(String[] args

int y=2;
int z=3;
int n=4;
n=n+-y*z/n;
System. out.println (n);


A. 3
B. -1
C. -3
D. -12
[单项选择]执行下列程序之后,变量n的值为( )。
public class Exam
public static void main(String[]args)
int y=2;
int z=3:
int n=4:
nzn+-Y*z/n:
System.out.println(n):


A. 3
B. -1
C. -12
D. -3
[单项选择]执行下面程序后输出的正确结果是
Public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(”,”);
System.out.print(x/y);


A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是
public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(",");
System.out.print(x/y);


A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是
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 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 d=101;
int b=220;
long a=321;
System.out.println((a-b)/(a-b-d));


A. ArraylndexOutOfBoundsException
B. NumberFormatException
C. ArithmeticException
D. EOFExcepfion
[单项选择]执行下面程序后输出的正确结果是( )。
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
[单项选择]执行下列程序段之后,变量b的值为______。
public class Test9

public static void main(String[] args)

int i=12;
int j=24;
boolean b1=true;
boolean b=(j%i== 0)&&(!b1) ||(j/i!=2);
System.out.println(b);


A. true B. false C. 1 D. 0
[单项选择]阅读下面程序
public class Test3
public static void main(String args[])
int x=3, y=4, z=5;
String s="xyz";
System.out.primln(s+x+y+z);


程序运行的结果是
A. xyzl2
B. xyz345
C. xyzxyz
D. 12xyz
[单项选择]执行下面程序后输出的正确结果是( )。 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, l
D. 1.0,1.0
[单项选择]阅读下面程序
public class Test implements Runnable
public static void main(String[]args)
_______________________________________;
t. start( );

public void mR( )
System. out. println("Hello!");

}
在程序下画线处填入正确选项是
A. Test t=flew Test()
B. Thread t=new Thread();
C. Thread t=new Thread(new Test());
D. Test t=new Thread();
[单项选择]阅读下面程序
public class Test3
public static void main (String args[])
int x=3,y=4,z=5;
String S="xyz";
System.out.printIn(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 .printIn(a++*b+c*--d);


程序运行的结果是______。
A. 144
B. 160
C. 140
D. 164
[单项选择]执行下面的程序后,输出的结果是______。
public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print( r/y);
System.out.print(",");
System.out.print(x/y);


A. 20.0, 1
B. 20.0, 2.0
C. 20, 0
D. 20, 1.0
[单项选择]下面的程序执行后,屏幕上应显示______。
public class Test
public static void main(String[] args)
char char1[]='t','e','s','t';
char char2[]='t','e','s','t','1';
String s1=new String(char1);
String s2=new String(char2,0 ,4);
System.out.println(s1.equals(s2));


A. true
B. false
C. test
D. 编译错误

我来回答:

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

订单号:

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