题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-30 03:05:52

[单项选择]阅读下面程序
public class OperatorsAndExpressions
 void equalsMethodl( )
  String s1=new String("how are you");
  String s2=new String("how are you");
  System.out.println(s1==s2);
 
 public static void main(String args[])
  OperatorsAndExpressions OperAndExp=new OperatorsAndExpressions( );
  //用于复合类型数据的“==”运算符
  OperAndExp.equalsMethodl( );
 

程序运行的结果是
A. ==
B. true
C. false
D. equal

更多"阅读下面程序 public class OperatorsAndEx"的相关试题:

[单项选择]请阅读下面程序
public class OperatorsAndExpressions
void residual( )
int i=100.j=30;
float m=563.5f,n=4.0f;
System,out.printIn (i%j);
System, .out.printIn (m%n);

public static void main (String args[])
OperatorsAndExpressions OperAndExp=new OperatorsAndExpressions( );
//取模运算在整数和浮点数中的应用
OperAndExp.residual( );


程序运算结果是______。
A. 10
B. 20
C. 10
D. -20
[单项选择]阅读下面程序
public class OperatorsAndExpressions
void equalsMethodl( )
String s1=new String("how are you");
String s2=new String("how are you");
System.out.println(s1==s2);

public static void main(String args[])
OperatorsAndExpressions OperAndExp=new OperatorsAndExpressions( );
OperAndExp. equalsMethod1( );


程序运行结果是( )。
A. ==
B. true
C. false
D. equal
[单项选择]阅读下面程序
public class OperatorsAndExpressions
void equalsMethodl( )
String s1=new String("how are you");
String s2=new String("how are you");
System.out.printIn (s1==s2);

public static void main (String args[])
OperatorsAndExpressions OperAndExp=new OperatorsAndExpressions( );
//用于复合类型数据的"= ="运算符
OperAndExp.equalsMethodl( );


程序运行结果是______。
A. ==
B. true
C. false
D. equal
[填空题]阅读下面程序
public class OperatorsAndExpressions
 String conditionalExpression(int score)
  String result;
   //如果score超过60分,则结果是passed,否则是doesn’t pass
   result=(score>=60)"passed":"doesn’t pass":
   System.out.println(result);
   return result;
 
 public static void main(String args[])
  OperatorsAndExpressions OperAndExp=new OperatorsAndExpressions( );
  //条件表达式
  OperAndExp.conditionalExpression(65);
 

程序的执行结果是______。
[单项选择]阅读下面程序:
public class OperatorsAndExpressions
 void residual
  int i=100,j=30;
  float m=563.5f,n=4.0f;
  System.out.println(i%j);
  System.out.println(m%n):
 
 public static void main(String args[])
  OperatorsAndExpressions OperAndExp=new OperatorsAndExpressions( );
  //取模运算符在整数和浮点数中的应用
  OperAndExp.residual( );
 

程序运行的结果是
A. 10
B. 20
C. 10
D. 20
[单项选择]阅读下面程序
public class Increment
 public static void main(String args[])
  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 ThreadTest
public static void inain(String args[]) throws Exception
int i=0;
Hello t=new Hello( );
______;
while(true)
System.out.printIn ("Good Morning"+j++);
if(i==2&&LisAlive( ))
System.out.printIn("Main waiting for Hello!");
T.join( );//等待t运行结束

if(i==5)break;



class Hello extends Thread
int i ;
public void run( )
while(true)
System.out.printIn("Hello"+i++);
if(i==5) break;



为使该程序正确执行,下画线处的语句应是______。
A. sleep()
B. yield()
C. interrupt()
D. start()
[填空题]请阅读下面程序 public class Test { public static void main (String[] args) { int i,j; for (i=1;i<5;i++) { for (j=1;j<=i;j++) system.out.print (i+"X"+j+"="+i*j+" "); System.out.println( ); } } } 程序执行完后,i循环和j循环执行的次数分别是 【12】
[简答题]阅读下列程序
public class VariableUse
public static void main(String[]args)
int a;
if(a==8)
int b=9;
System.out.println(’a=’+a);
Systern.out.println(’b=’+b);
System.out.println(’a=’+a);
System.out.println(’b=’+b);


该程序在编译时的结果是( )。
[单项选择]下面程序段的输出结果是
public class Test
public static void main(String args[])
int x,y;
x=(int)Math.sqrt(5)/2+(int)Math.random( )*5/2;
y=(int)Math.sqrt(3)/2+(int)Math.random( )*3/2;
if(x>y)
System.out.println("x>y");
else if(x==y)
System.out.println("x=y");
else
System.out.println("x<y");


A. x>y
B. x=y
C. x<y
D. 编译错误

我来回答:

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

订单号:

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