首页 > 工商管理> 管理学
题目内容 (请给出正确答案)
[主观题]

阅读下面程序,判断它的输出结果class UseURL{public static void main(String args [ ]){URL u

阅读下面程序,判断它的输出结果

class UseURL{public static void main(String args [ ])

{URL url=null;try

{url=new URL("http://java.sun.com:8080/java/doc1.html");}

catch(MalformedURLException e)

{System.out.println("MalformedURLException.");}

System.out.println(url.toString());}}

A、MalformedURLException.

B、http://java.sun.com:8080/java.doc1.html

C、http://java.sun.com/java.doc1.html

D、//java.sun.com/java.doc1.html

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“阅读下面程序,判断它的输出结果class UseURL{pu…”相关的问题
第1题
下面程序段的输出结果为_______。public class Test { public static void main(String args
[]){ char c1,c2,c3; c1='H'; c2='\\'; c3='\115'; System.out.print(c1); System.out.print(c2); System.out.print(c3);

A.H\M

B.H\\\115

C.H115

D.无输出

点击查看答案
第2题
下面程序段的输出结果为_______。public class NewClass { public static void main(String a
rgs[]){ int x,y; x=(int)82.5; y=(int)'A'; System.out.print("x="+x); System.out.print("\ty="+y); } }

A.82 A

B.82 65

C.82.5 A

D.82.5 65

点击查看答案
第3题
关于下面程序,结论正确的是()。

public class J_Test {

public static void main(String[] args) {

int[] a = new int[5];

boolean[] b = new boolean[5];

System.out.println(a[4]);

System.out.println(b[5]);

}

}

A.程序可以通过编译并正常运行,结果输出“0false”

B.程序可以通过编译并正常运行,结果输出“1true”

C.程序无法通过编译

D.程序可以通过编译,但无法正常运行

点击查看答案
第4题
下面程序段的输出结果为_______。class OverMethod{ void printMeth(){ System.out.println(&
quot;There is none parameter."); } void printMeth(String t){ System.out.println("There is one parameter."); } void printMe

A.There is one parameter.There is none parameter.There are two parameters.

B.There is none parameter.There is one parameter.There are two parameters.

C.There is none parameter.It’s good!There are tw

D.It’s good!There is none parameter.There are two parameters.

点击查看答案
第5题
下面程序段的输出结果为()。public class MethLoad {public static void main(String args[]
{MethLoad classObj=new MethLoad();classObj.methTest(4);classObj.methTest(4.0);}void methTest(double d){double sum=2*d};}

A.The result is:16 The result is:8.0

B.The result is:8.0 The result is:16

C.The result is:8 The result is:16.0

D.The result is:16.0 The result is:8

点击查看答案
第6题
阅读下面代码: import java.awt.*; public class Exam11_1 { private Frame.
f; private Button bl,b2,b3,b4; public static void main(String args[] { Exam11_1 that = new Exam11_1 (); that.go(); } public void go () { ______; f.setLayout(new FlowLayout());; bl = new Button ("Button 1"); b2 = new Button ("Button 2"); b3 = new Button ("Button 3"); b4 = new Button ("Button 4"); f.add(b1); f.add(b2); f.add(b3); f.add(b4); f.pack(); f.setVisible(true); } } 请在程序中画线处填写正确的语句【 】,以便编译运行程序后得到正确的结果。

点击查看答案
第7题
下面程序段的输出结果为public class Test { public static void main(String args[]){ int
a[]={1,2,3},b[]=new int [3]; System.arraycopy(a, 0, b, 0, 3); System.out.println("a[0]="+a[0]+" b[0]="+b[0]); a[0]=10; System.out.println("a

A.a[0]=1 b[0]=1 a[0]=10 b[0]=1

B.a[0]=1 b[0]=10 a[0]=1 b[0]=10

C.a[0]=10 b[0]=1 a[0]=10 b[0]=1

D.a[0]=10 b[0]=10 a[0]=1 b[0]=1

点击查看答案
第8题
“阅读下面程序 class ex3124 { public static void main(String [] args) { boolean b=true; if(b){ int i=1;} else { int i=2;}System.out.println(i);}} 现在想先编译再运行该程序,结果是()

A.运行出错

B.编译出错

C.2

D.1

点击查看答案
第9题
下面程序段的输出结果是_______。class Base{ int i; Base(){ add(1); } void add(int v){ i+=v; } void print(){ System.out.println(i); } } class Extension extends Base{ Exten

A.9

B.22

C.20

D.18

点击查看答案
第10题
执行下面的程序段,输出结果为【 】。 public class Q { public Static Void main(String arg

执行下面的程序段,输出结果为【 】。 public class Q { public Static Void main(String args[]) { int anar[]=new int[5]; System.out.println(anar[0]); } }

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改