网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

阅读下面一段代码 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.true true true

B.false false true

C.false false false

D.false true false


参考答案和解析
B.false false true
更多 “阅读下面一段代码 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.true true trueB.false false trueC.false false falseD.false true false” 相关考题
考题 本题中,用表格表现某个月的月历,其中标题是从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

考题 下列程序中,实现将封装数据类型Integer和基本数据类型int之间的转换,以及Integer,int类型和String类型之间的转换。请将程序补充完整。程序运行结果如下:123456456public class ex7_1{public static void main(String[]args) {Integer intObj;int n;String s;intObj = new Integer(123);n=intObj.__________;System.out.printin(Integer.toString(n));s=new String("456");intObj=Integer._________;System.out.println(intObj.__________);n=Integer.parseInt(s);System.out.println(Integer.toString(n));}}

考题 设程序中有如下数组定义和过程调用语句: Dim a(10)As Integer … Call D(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)

考题 下面是一个Applet程序,其功能是接收用户输入的两个整数,比较它们的大小,并在用户按下“比较大小”按钮后,将 Applet中显示的“请先输入两个待比较的整数”,改为“两个整数中最大值是:x”,x是两个数中的最大值。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。注意:不改动程序的结构,不得增行或删行。程序运行结果如下:import java.applet.*;import java.awt.*;import java.awt.event.*;/*<applet code=LookForMax width=800 height=400></applet>*/public class LookForMax extends Applet implements ActionListener{Label result ;TextField inl,in2;Button btn;int a=0,b=0,max=0;public void init(){result=new Label ("请先输入两个待比较得整数");in1=new TextField(5);in2=new TextField(5);btn=new Button("比较大小");add(in1);add(in2);add(btn);add(result);btn.addActionListener(supper);}public void actionPerformed(ActionEvent e){a=Integer.parseInt(in1);b=Integer.parseInt(in2);if(a>b)max=a;elsemax=b;result, setText ( "两个数中最大值是:"+max);}}LookFormax.html:<html><head><title>A Simple Program</title></head><body><applet code="LookForMax.class" width=800 height=400></applet></body></html>

考题 以下能正确定义数据类型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

考题 有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End SubA.0B.10C.50D.100

考题 以下能正确定义数据类型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

考题 设程序中有如下数组定义和过程调用语句: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

考题 Dim arrInt()as Integer=New Integer(2){}

考题 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、编译失败

考题 Dim arrInt()as Integer=New Integer(2){0,1,2}

考题 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 编译失败

考题 填空题下列程序的运行结果是()。  Program test      Implicit none      Integer,parameter:: limit=10      Integer counter      Integer:: ans=0      Counter=2     do while(counter=limit)      ans=ans+counter      counter=counter+2   end do Wrte(*,*)ans end