题目内容 (请给出正确答案)
[主观题]

阅读下面程序 public class OperatorsAndExpressions { String conditionalExpression(int scor

阅读下面程序

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 perAndExp=new OperatorsAndExpressions();

//条件表达式

OperAndExp.conditionalExpression(65);

}

}

程序的执行结果是______。

提问人:网友qqcc135 发布时间:2022-01-06
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“阅读下面程序 public class OperatorsA…”相关的问题
第1题
运行以下代码: class PassS{ public static void main(String[] args){ PassS p=new PassS( ); p.start( ); } void start( ){ String s1=”slip”; String s2=fix(s1); System.out.println(s1+” ”+s2); } String fix(String s1){ s1=s1+”stream”; System.out.print(s1+” ”); return “stream”; } } 运行结果是( )。

A、slip stream

B、slipstream stream

C、stream slip stream

D、slipstream slip stream

点击查看答案
第2题
下列代码的执行结果是 f=open('writetest.txt','a+') f.write('This is a test file') f.write('Please print this file') print(f.readline()) f.seek(0) print(f.readlines())

A、This is a test file This is a test file Please print this file

B、This is a test filePlease print this file This is a test file Please print this file

C、['This is a test filePlease print this file']

D、This is a test filePlease print this file

点击查看答案
第3题
下列代码段的执行结果为()。 public class BitOperator { public static void main(String args[ ]) { int a=-67,b-116,c=78,d; d=~C>>2&(a|~B) ; System.out.println("d="+D) ; } }

A.d=70

B.d=67

C.d=78

D.d=116

点击查看答案
第4题
程序的运行结果是 public class Example02 { public static void main(String[] args) { int x = 0; // 定义变量x,初始值为0 int y = 0; // 定义变量y,初始值为0 boolean b = x==0 || y++<0; system.out.println("b="+b+" , y="+y); } } &lt;br&gt; A、b = false, y = 0 &lt;br&gt; B、b = false, y = 1 &lt;br&gt; C、b = true, y = 0 &lt;br&gt; D、b = true, y = 1 &lt;br&gt; &lt;p class=" answer">

8、下列选项中,关于运算符“^”的描述正确是

A、二进制位有1,则结果为1

B、二进制位有0,则结果为0

C、二进制位有相同,则结果为1,不同为0

D、二进制位有相同,则结果为0,不同为1

点击查看答案
第5题
下面代码正确吗? public class Test implements Runnable { public static void main(String[ ] args) { Test t = new Test(); } public Test() { Thread t = new Thread(this); t.start(); } public void run() { System.out.println("test"); } }
点击查看答案
第6题
public static void main方法的参数描述正确的有()。

A. String args[]

B. String[] args

C. Strings args[]z

D. String args

E. Strings arg[]

点击查看答案
第7题
如下程序 Class Example1 { public Static void main() { int x=1,a=0,b=0; switch(x) { case 0:b++;break; case 1:a++;break; case 2:a++;b++;break; } Console.WriteLine("a={0},b={1}",a,b); } } 的输出结果是( )

A、a=2,b=1

B、a=1,b=1

C、a=1,b=0

D、a=2,b=2

点击查看答案
第8题
测试如下代码: public class Ref{ public static void main(String[] args) { StringBuffer sbl = new StringBuffer("Hello"); StringBuffer sb2 = new StringBuffer("Hello"); boolean result = sbl.equals(sb2); System.out.println(result); } } 下述哪条语句正确描述了程序编译和运行的行为?

A、编译成功,输出为 true

B、编译成功,输出为 1

C、编译成功,输出为 false

D、编译成功,输出为 0

点击查看答案
第9题
运行以下代码: class Equals{ public static void main(String[] args){ int x=100; double y=100.1; boolean b=(x=y); System.out.println(b); } } 运行结果是( )。

A、true

B、false

C、编译出错

D、抛出一个异常

点击查看答案
第10题
8、下列异常声明中,正确的是( )

A、A.public void throws IOException fun(){}

B、B.public void fun throws IOException(){}

C、C.public void fun()throws IOException{}

D、D.public void fun()throws IOException,throws SQLException{}

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信