早教吧作业答案频道 -->其他-->
关于java一些题目,1.Whatdoesthefollowingstatementdoif(s1.compareTo(s2)<0)x=4;Setsxto4ifs2comesbefores1inalphabeticorder.Setsxto4ifs1comesbefores2inlexigraphicorder.Setsxto4ifs1comesbefores2inalphabetic
题目详情
关于java一些题目,
1.What does the following statement do
if (s1.compareTo(s2) < 0)
x = 4;
Sets x to 4 if s2 comes before s1 in alphabetic
order.
Sets x to 4 if s1 comes before s2 in lexigraphic
order.
Sets x to 4 if s1 comes before s2 in alphabetic
order.
Sets x to 4 if s2 comes before s1 in lexigraphic
order.
2.是非题
The values of an enumeration behave much like named
constants - and the same naming conventions are used.
True
False
3.When does it make sense to use a switch statement instead
of an if-else statement?
a.When a multiway if-else statement has many possible
outcomes and the choice is based on an integer or a
character.
b.When a multiway if-else statement has one possible
outcome and the choice is based on an float or a
double.
c.When a multiway if-else statement has many possible
outcomes and the choice is based on an float or a
double.
d.When a multiway if-else statement has one possible
outcome and the choice is based on an integer or a character.
4.
Which of the following assigns the enum value A to rating
given the following code:
enum MovieRating {E,A,B}
MovieRating rating;
a.rating = MovieRating.A;
b.rating = A;
c.rating = "A";
d.rating = 'A';
1.What does the following statement do
if (s1.compareTo(s2) < 0)
x = 4;
Sets x to 4 if s2 comes before s1 in alphabetic
order.
Sets x to 4 if s1 comes before s2 in lexigraphic
order.
Sets x to 4 if s1 comes before s2 in alphabetic
order.
Sets x to 4 if s2 comes before s1 in lexigraphic
order.
2.是非题
The values of an enumeration behave much like named
constants - and the same naming conventions are used.
True
False
3.When does it make sense to use a switch statement instead
of an if-else statement?
a.When a multiway if-else statement has many possible
outcomes and the choice is based on an integer or a
character.
b.When a multiway if-else statement has one possible
outcome and the choice is based on an float or a
double.
c.When a multiway if-else statement has many possible
outcomes and the choice is based on an float or a
double.
d.When a multiway if-else statement has one possible
outcome and the choice is based on an integer or a character.
4.
Which of the following assigns the enum value A to rating
given the following code:
enum MovieRating {E,A,B}
MovieRating rating;
a.rating = MovieRating.A;
b.rating = A;
c.rating = "A";
d.rating = 'A';
▼优质解答
答案和解析
2、false
3、C
4、C
介于我的外语成绩借助了翻译工具,第一天我实在是觉得翻译的我看不懂,其他的正确率我不能保证,这能帮到这里了
3、C
4、C
介于我的外语成绩借助了翻译工具,第一天我实在是觉得翻译的我看不懂,其他的正确率我不能保证,这能帮到这里了
看了 关于java一些题目,1.W...的网友还看了以下:
1.a≠0,b≠0,则a/|a|+b/|b|的不同取值的个数为()A.3B.2C.1D.02.若|x 2020-03-31 …
已知AB两点的坐标是A(a,3)B(-4,b)根据下列条件求出a,b的值1.A,B两点关于y轴对称 2020-04-27 …
基本不等式超费解130已知a>b>0,求a2+1/(a*b)+1/[a*(a-b)]的最小值.a2 2020-05-13 …
设集合A={1,a,b},B={a,a^2,ab}且A=B,求实数A,B的值因为集合需要满足互异性 2020-05-15 …
假设集合A满足以下条件:诺a∈A,a不等于1,则1-a分之1属于A若a属于A,则1-a分之一属于A 2020-07-03 …
高一复数题(会任意一道都行)1.设复数z1、z2、A(A≠0)满足关系式z1z2拔+A拔z1+Az2 2020-10-31 …
急救!脑细胞死光嘞!急救!①已知:M+M分之一=3,求M²+M²分之一.②设A=x+y,B=xy,C 2020-12-19 …
如图所示,一个原来不带电的金属球壳内,在其球心放一个负点电荷,那么关于A、B、C三点的电势ϕA、ϕB 2021-01-09 …
递回关系式的运算公式(数列)以下是推导一个公式"a=a+r(1-p^n)/(1-p)"的过程a=p* 2021-01-13 …
如图电路中,a和b是完全相同的灯泡,线圈L的电阻可忽略.下列说法正确的是()A.合上开关S,b灯比a 2021-01-13 …