早教吧作业答案频道 -->英语-->
请问这个关于Java的题目怎么选?我是初学者,WhichofthefollowingJavawhile-loopsis(are)infinite?while(true)i=0;while(false)i=1;whilefalse)i=0;(a)IandIIIonly(b)I,II,andIII(c)IIIonly(d)Ionly
题目详情
请问这个关于Java的题目怎么选?我是初学者,
Which of the following Java while-loops is (are) infinite?
while (true) i = 0;
while (false) i = 1;
while false) i = 0;
(a) I and III only
(b) I,II,and III
(c) III only
(d) I only
Which of the following Java while-loops is (are) infinite?
while (true) i = 0;
while (false) i = 1;
while false) i = 0;
(a) I and III only
(b) I,II,and III
(c) III only
(d) I only
▼优质解答
答案和解析
答案选(a).
感叹号代表逻辑取反,true取反后为false,反之亦然.则III中的!false即为true.
题目要求选出所有的死循环,而while()型语句当括号内的布尔值为真时,将一直执行,即为死循环,可知I与III中,括号内的布尔值恒为true,即恒真,成为死循环.故答案选a.
感叹号代表逻辑取反,true取反后为false,反之亦然.则III中的!false即为true.
题目要求选出所有的死循环,而while()型语句当括号内的布尔值为真时,将一直执行,即为死循环,可知I与III中,括号内的布尔值恒为true,即恒真,成为死循环.故答案选a.
看了 请问这个关于Java的题目怎...的网友还看了以下:
I was walking in the street _____someone calledI 2020-05-14 …
this book is 115 pages,that book is 120 pages thi 2020-05-16 …
The price of this exercise book is the lowest,--- 2020-05-16 …
She had just finished her homework___her mother a 2020-05-16 …
#[66] I will remember the happy time ______I spen 2020-05-16 …
____ she came in,i was writing a letter A when B 2020-05-17 …
one should never think that he is perfect ,___oth 2020-05-17 …
A. when B. while C. how D. why 2020-05-25 …
根据图,下列关于神经细胞的叙述,错误的是()A.静息电位的形成可能与膜上的b物质有关B.在c处给一足 2020-12-27 …
根据图,下列关于神经细胞的叙述,错误的是()A.静息电位的形成可能与膜上的b物质有关B.在c处给一足 2020-12-27 …