网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
boolean和int之间不能相互赋值
参考答案和解析
正确
更多 “boolean和int之间不能相互赋值 boolean和int之间不能相互赋值” 相关考题
考题
下列关于boolean类型的叙述中,正确的是A.可以将boolean类型的数值转换为int类型的数值B.可以将boolean类型的数值转换为字符串C.可以将boolean类型的数值转换为char类型的数值D.不能将boolean类型的数值转换为其他基本数据类型
考题
在匹配器(Marcher)类中,用于寻找下一个模式匹配串的方法是( )。A.static boolean matches()B.boolean matcher.find()C.int matcher.start()D.int matcher.end()
考题
下面声明和赋值语句中,错误的是( )。A.float z=6.56;B.double d=3.1415;C.boolean truth=true;D.String str="bye";
考题
有如下程序:includeclass Base{protected:int i;public:int j;};class Derived:pub
有如下程序: #include<iostream.h> class Base { protected:int i; public:int j; }; class Derived:public Base { int m; public:int n; }; int main() { Derived d; d.i=0; //[1]d.j=0; //[2]d.m=0; //[3]d.n=0; //[4]return 0; } 其中主函数中有两个赋值语句有错,这两个错误的赋值语句是( )。A.[1]和[2]B.[1)和[3]C.[2]和[3]D.[2]和[4]
考题
下列声明和赋值语句错误的是( )。A.double w=3.1415;B.String strl="bye":C.float z=6.74567;D.boolean true=true:
考题
在匹配器(Matcher)类中,用于寻找下一个模式匹配串的方法是( )。 A.static boolean matchesSXB
在匹配器(Matcher)类中,用于寻找下一个模式匹配串的方法是( )。A.static boolean matchesB.boolean matcher.findC.int matcher.startD.int matcher.end
考题
下列关于boolean类型的叙述中,正确的是( )。A.可以将boolean类型的数值转换为int类型的数值SX
下列关于boolean类型的叙述中,正确的是( )。A.可以将boolean类型的数值转换为int类型的数值B.可以将boolean类型的数值转换为字符串C.可以将boolean类型的数值转换为char类型的数值D.不能将boolean类型的数值转换为其他基本数据类型
考题
本题定义了一个长度为l0的boolean型数组,并给数组元素赋值,要求如果数组元素下标为奇数,则数组元素值 为false,否则为true。 public class javal{ pubhc static void main(String[]args){ boolean b[]= ; for(int i=0;i10;i++){ if( ) b[i]=false; else ; } for(int i=0;i10;i++) System.Out.print("bE"+i+"]="+b[i]+","); } }
考题
在匹配器(Matcher)类中,用于输入字符串与模式串比较的方法是A.static boolean matches()B.boolean matcher,find()C.int matcher,start()D.int matcher,end()
考题
下列方法中哪个方法是Sprite类中用来设置对准点的方法:()A、setRefPixelPosition(int x,int y)B、defineReferencePixel(int x,int y)C、setVisible(boolean visible)D、setPosition(int x,int y)
考题
int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()A、 Foo has the value of 0.B、 Foo has the value of null.C、 Foo has the value of true.D、 Foo has the value of false.E、 An exception is thrown.F、 The code will not compile.
考题
public class Key { private long id1; private long 1d2; // class Key methods } A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works correctly as a key?()A、 public int hashCode()B、 public boolean equals(Key k)C、 public int compareTo(Object o)D、 public boolean equals(Object o)E、 public boolean compareTo(Key k)
考题
单选题int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()A
Foo has the value of 0.B
Foo has the value of null.C
Foo has the value of true.D
Foo has the value of false.E
An exception is thrown.F
The code will not compile.
考题
单选题下列方法中哪个方法是Sprite类中用来设置对准点的方法:()A
setRefPixelPosition(int x,int y)B
defineReferencePixel(int x,int y)C
setVisible(boolean visible)D
setPosition(int x,int y)
考题
单选题以下函数findmax拟实现在数组中查找最大值并作为函数值返回,但程序中有错导致不能实现预定功能。#define MIN -2147483647int fingmax (int x[],int n){ int i,max; for(i=0;i
A
定义语句int i,max;中,max未赋初值B
赋值语句max=MIN;中,不应给max赋MIN值C
语句if(maxx[i])max=x[i];中,判断条件设置错误D
赋值语句max=MIN;放错了位置
考题
单选题如果A为“Boolean”型数据,则下列赋值语句正确的是( )。A
A=trueB
A=.trueC
A=#TRUE#D
A=34
热门标签
最新试卷