网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
阅读下面一段代码,代码的输出结果是() Integer in1 = new Integer(10); Integer in2 = new Integer(10); Integer in3 = 10; Integer in4 = 10; System.out.print(in1 == in2); System.out.print(in1 == in3); System.out.print(in3 == in4);
A.truetruetrue
B.falsefalsetrue
C.falsefalsefalse
D.falsetruefalse
参考答案和解析
2,2
更多 “阅读下面一段代码,代码的输出结果是() Integer in1 = new Integer(10); Integer in2 = new Integer(10); Integer in3 = 10; Integer in4 = 10; System.out.print(in1 == in2); System.out.print(in1 == in3); System.out.print(in3 == in4);A.truetruetrueB.falsefalsetrueC.falsefalsefalseD.falsetruefalse” 相关考题
考题
本题中,用表格表现某个月的月历,其中标题是从Sunday到Saturday,表格中的各项是可以修改的。 import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.table.*; public class java2 ( public static void main(String[]args) { try{ UIManager.setLookAndFeel(UIManager.getSys- temLookAndFeelClassName): } catch(Exception e) JFrame. frame=new CalendarTableFrame; frame.setDefaultCloseOperation(JFrame.EXIT_ oN CLOSE); frame.show; } } clasgCalendarTableFrame. extends JFrame { private static final int WIDTH=500; private static final int HEIGHT=150: private cells= { {null,null,null,new Integer(1),new Integer (2),new Integer(3),new Integer(4)), {new Integer(5),new Integer(6),new Integer (7).new Integer(8),new Integer(9),new Integer (10),new Integer(11)), {new Integer(12),new Integer(13),new Integer (14),new Integer(15),new Integer(16),new Integer (17),new Integer(18)), {new Integer(19),new Integer(20),new Integer (21),new Integer(22),new Integer(23),new Integer (24),new Integer(25)), {new Integer(26),new Integer(27),new Integer (28),new Integer(29),new Integer(30),new Integer (31),null} }; private String[]columnNames={ "Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday" }; public CalendarTableFrame{ setTitle("java2"); setSize(WIDTH,HEIGHT); JTable table=new ; getContentPane.add(new JScrollPane(table), BorderLayout.CENTER); } }
考题
在窗体上画一个命令按钮,然后编写如下程序: Sub S1(ByVal x As Integer,ByVal y As Integer) Dim t As Integer t=x x=y y=t End Sub Private Sub Command1_Click() Dim a As Integer,b As Integer a=10 b=30 S1 a,b Print"a=";a;"b=";b End Sub 程序运行后,单击命令按钮,输出结果是 ______。A.a=30 b=10B.a=30 b=30C.a=10 b=30D.a=10 b=10
考题
如果Add函数的调用代码为:func main() {var a Integer = 1var b Integer = 2var i interface{} = asum := i.(Integer).Add(b)fmt.Println(sum)}则Add函数定义正确的是()
A.type Integer intfunc (a Integer) Add(b Integer) Integer { return a + b}B.type Integer intfunc (a Integer) Add(b *Integer) Integer { return a + *b}C.type Integer intfunc (a *Integer) Add(b Integer) Integer { return *a + b}D.type Integer intfunc (a *Integer) Add(b *Integer) Integer { return *a + *b}
考题
classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt(forty));}catch(RuntimeExceptionr){System.out.print(runtime);}catch(NumberFormatExceptione){System.out.print(number);}}}结果是什么?()A.fortyB.numberC.runtimeD.编译失败
考题
Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。A.6, 8B.10, 10C.10, 8D.6, 10
考题
以下能正确定义数据类型TelBook的代码是_________。A.Type TelBook Name As String*10 TelNum As Integer End TypeB.Type TelBook Name As String*10 TelNum As Integer End TelBookC.Type TelBook Name String*10 TelNum Integer End Type TelBookD.TypedefTelBook NameString*10 TelNum Integer End Type
考题
以下能正确定义数据类型TelBook的代码是A.TypeTelBook Name As String*10 TelNum As Integer EndTypeB.Type TelBook Name As String*10 TelNum As Integer End TelBookC.Type TelBook Name String*10 TelNum Integer EndTypeTelBookD.Typedef TelBook Name String*10 TelNum Integer End Type
考题
下面哪些代码在Java语言中是合法的? ( )A.string A="abcdefg"; A-="cde";B.string A="abcdefg"; A+="cde";C.Integer J=new Integer(27); J-=7;D.Integer J=new Integer(27); J--;
考题
以下能正确定义数据类型TelBook的代码是 ______。A.Type TelBook Name As String*10 TelNum As Integer End TypeB.Type TelBook Name As String*10 TelNun As Integer End TelBookC.Type TelBook Name String*10 TelNum Integer End Type TelBookD.TypedefTelBook Name String*10 TelNum Integer End Type
考题
在窗体上画一个命令按钮,然后编写如下程序:Sub S1(ByVal x As Integer, By Val y As Integer) Dim t As Integer t=x x=y y=tEnd SubPrivate Sub Command1_ Click() Dim a As Integer, b As Integer a=10 b=30 S1 a,b Print "a=";a="b=";bEnd Sub 程序运行后,单击命令按钮,输出结果是______。A.a=30 b=10B.a=30 b=30C.a=10 b=30D.a=10 b=10
考题
在窗体上画—个命令按钮(名称为Command1),并编写如下代码:Function Fun1 (ByVala As Integer, b As Integer)As Integer Dim t As Integer t=a-b b=t+ a Fun 1=t+ bEnd FunctionPrivate Sub Command1_ Click() Dim x As Integer x=10 Print Fun1(Fun1 (x,(Fun1(x,x-1))),x-1)End Sub程序运行后,单击命令按钮,输出结果是 ______。A.10B.0C.11D.21
考题
设程序中有如下数组定义和过程调用语句:Dim a(10) as integer……Call p(a)如下过程定义中,正确的是A)Private Sub p(a as integer)B)Private Sub p(a() as integer)C)Private Sub p(a(10) as integer)D)Private Sub p(a(n) as integer)
考题
用整数10创建一个Integer类的对象,下列各语句中能完成此功能的是( )。A.Integer i=new Integer(10);B.Integer i=10;C.int i=10;D.Integer i=Integer(10);
考题
在窗体上画一个命令按钮,然后编写如下事件过程: Sub BTC(old Copy( ) As Integer,new Copy( ) As Integer) Dim i AS Integer For i=LBound(oldCopy( ))To UBound(oldCopy( )) newCopy(i)=oldCopy(i) Next i End Sub Private Sub Command1 _ Click( ) Dimm(10) As Integer,n(10)As Integer For i=1 To 10 m(i) =i*i Next i Call BTC(m,n) Print n(5) End Sub 程序运行后,单击命令按钮输出结果为A.0B.2C.10D.25
考题
以下程序运行后,单击按钮输出结果是 Private Sub Commandl_Click( ) Dim x As Integer,y As Integer,z As Integer X=4:y=2: Z=3 Call Gopd(x,x,z) Print x;X;Z Call Gopd(x,y,y) Print x;y;y End Sub Private Sub Gopd(x As Integer,y As Integer,z As Integer) X=3 * Z + 1 y=2 * z z=x + y End SubA.6 6 12 7 11 11B.8 5 10 5 11 11C.9 6 12 9 10 15D.8 10 10 5 9 10
考题
单击按钮时,以下列程序运行后的输出结果是 Private Sub proc1(x As Integer,y As Integer,z As Integer) x=3*z y=2*z z=X+y End Sub Private Sub Command1_Click( ) Dim x As Integer,y As Integer,z As Integer x=1:y=2:z=3 Call proc1(x,x,2) Print x;x;z Call proc1(x,y,y) Print x;y;y End SubA.6 6 12 6 6 10B.9 5 10 5 10 10C.9 6 12 9 10 15D.9 5 10 5 4 10
考题
单击按钮时,以下程序运行后的输出结果是 Private Sub Commandl_Click( ) Dim X As Integer,y As Integer,z As Integer x=1:y=2: Z=3 Call God(x,x,z) Print x;x;z Call God(x,y,y) Print X;y;y End Sub Private Sub God(x As Integer,y As Integer,z As Integer) x=3 * Z + 1 y=2 * Z z=x + y End SubA.6 6 12 7 11 11B.8 5 10 5 11 11C.9 6 12 9 10 15D.8 10 10 5 9 10
考题
class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x 〈 new Integer(44-1)) { System.out.println("less"); } else { System.out.print("done"); } } } 结果是什么?() A、lessB、42C、doneD、编译失败
考题
public static void main( String[] args ) { Integer a = new Integer(10); Integer b = new Integer(10); Integer c = a; int d = 10; double e = 10.0; } Which three evaluate to true?() A、 (a == c)B、 (d == e)C、 (b == d)D、 (a == b)E、 (b == c)F、 (d == 10.0)
考题
class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x.equals(42)) { System.out.print("dot = "); } else { System.out.print("done"); } } } 结果为:() A、42B、doneC、dot =D、编译失败
考题
class Beta{ public static void main(String[] args){ Integer x=new Integer(6)*7; if(x!=42){ System.out.print(“42”); } else if(xSystem.out.println(“less”); }else{ System.out.print(“done”); }}} 结果是什么?() A、doneB、编译失败C、运行的时候有异常抛出D、lessE、42
考题
多选题public static void main( String[] args ) { Integer a = new Integer(10); Integer b = new Integer(10); Integer c = a; int d = 10; double e = 10.0; } Which three evaluate to true?()A(a == c)B(d == e)C(b == d)D(a == b)E(b == c)F(d == 10.0)
考题
单选题class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x 〈 new Integer(44-1)) { System.out.println("less"); } else { System.out.print("done"); } } } 结果是什么?()A
lessB
42C
doneD
编译失败
考题
单选题class Beta{ public static void main(String[] args){ Integer x=new Integer(6)*7; if(x!=42){ System.out.print(“42”); } else if(xSystem.out.println(“less”); }else{ System.out.print(“done”); }}} 结果是什么?()A
doneB
编译失败C
运行的时候有异常抛出D
lessE
42
考题
单选题class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x.equals(42)) { System.out.print("dot = "); } else { System.out.print("done"); } } } 结果为:()A
42B
doneC
dot =D
编译失败
热门标签
最新试卷