题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-12 19:44:16

[单项选择]请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是______。
程序代码:
public class throwsException
static void Proe(intsel)
throws Arithmetic Exception, Array Index Out OfBounds Exception
System. out. println("InSituation"+sel);
if(sel==0)
System. out. println( "noExeeption caught")
return;

else if(sel==1)
int iArray[]=newint[4];
iArray[1]=3;


public static void main(String args[])
try
Proc(0);
Proc(1);

catch(Array Index Out Of Bounds Exception e)
System. out. println( "Catch"+e);

finally
System. out. println("inProcfinally");



执行结果:
In Situation 0
no Exception caught
______
in Proc finally
A. In Situation 1
B. In Situation
C. with Catch
D. int iArray 1

更多"请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是"的相关试题:

[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。 程序代码: public class throwsExcepfion{ static void Proc(int se1) throws ArithmeticException,ArraylndexOutOfBoundsException { System.out.println("in Situation"+se1); if(se1==0){ System.out.println("no Exception caught"); return; }else if(se1==1){ int iArray[]=new int[4]; iArray [1]=3; } } public static void main(String args[])[ try{ Proc(0); Proc(1); } catch(ArraylndexOutOfBoundsException e) { System.out.println("Catch"+e); }finally{ System.out.println("in Proc finally"); } } } 执行结果: In Situation( ) no ExcepbOn cauSht 【14】 in Proc findly
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
Public class throwsException
static voidProc(intsel)
throws ArtthmeticExcepdon,AITaylndexOut of BoundsException
System.out println("In SimatiOn"+Sel);
if(sel==0)
System.out.println("noExceptioncallght");
return;

elseif(sel==1)
intiArray[]=newint[4];
i Array[1]=3;


public static void main(Stringargs[])
tfy
Proc(0);
Proc(1);

catch(ArraylndexOutOfBoundsExceptione)
System.out.println("Catch"+e);

flnally
Systern.out.println("inProcfinally");



执行结果:
In Situattion 0
no Exceptioncaught
inProcfinally
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsExcepfion
static void Proc(int se1)
throws ArithmeticException,ArraylndexOutOfBoundsException
System.out.println("in Situation"+se1);
if(se1==0)
System.out.println("no Exception caught");
return;
else if(se1==1)
int iArray[]=new int[4];
iArray [1]=3;


public static void main(String args[])[
try
Proc(0);
Proc(1);
catch(ArraylndexOutOfBoundsException e)
System.out.println("Catch"+e);
finally
System.out.println("in Proc finally");



执行结果:
In Situation( )
no ExcepbOn cauSht
【14】
in Proc findly
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsException
static void Proc(int sel)
throws ArithmeticException,ArrayIndexOutOfBoundsException
System.out.println("In Situation"+sel);
if(sel==0)
System.out.println(’no Exception caught");
return;

else if(sel==1)
int iArray[]=new int[4];
iArray[1]=3;


public static void main(String args[])
try
Proc(0);
Proc(1);

catch(ArrayIndexOutOfBoundsException e)
System.out.println("Catch"+e);

finally
System.out.println("in Proc finally");



执行结果:
In Situation 0
no Exception caught
【14】
in Proc finally
[单项选择]要使下列程序能够正确运行,则横线处应填写的内容是______。
import java. awt. * ;
import java. applet. * ;
public class SayHi extends Applet
public void______(Graphics g)
g. drawString("Hi!", 20,20);


A. int
B. start
C. paint
D. stop
[单项选择]下面的子程序是将AL寄存器低4位中的十六进制数转换为ASCII码,试问:该子程序中的横线处应填写什么指令
HTOASC PROC
AND AL, OFH
ADD AL, 30H
CMP AL, 39H
JBE DONE
____________
DONE: RET
HTOASC ENDP
A. SUB AL,’A’-0AH
B. ADD AL,’A’-0AH
C. SUB AL,’A’-07H
D. ADD AL,’A’-07H
[简答题]在下面程序横线处填上适当内容,使程序执行结果为:40:15程序如下:
#include<iostream.h>
template<class T>
T func(T x,T y)
if(sizeof(T)= =8)
return______;
else
return______;

void main( )
cout<<func(8,5)<<":"<<func(5.0,10.0)<<endl;
int d;cin>>d;

[简答题]在下面程序横线处填上适当内容,使程序执行结果为:
n=9
程序如下:
#include<iostream.h>
template<class T>
class Test

T n;
public:
Test( )
Test(T i)n=i;
Test<T>______(const Test <T> &s)

static Test<T>temp:
______;
return temp;

void disp( )cout<<"n="<<n<<endl;

void main( )

Test<int>t1(4),t2(5),t3;
t3=t1+t2:
t3.disp( );

[单项选择]下列横线处应填写的语句是______。
import java. awt. * ;
public class FirstFrame extends Frame
public static void main(String args[])
FirstFrame fr=new FirstFrame("First container!");
fr. setSize(240,240);
fr. setBackground(Color. yellow);

public FirstFrame(String str)
super(str);


A. fr. setVisible(true)
B. fr. setVisible(false)
C. fr. setFrame(true)
D. fr. setmyFrame(true)
[简答题]在下面程序的横线处填上适当内容,使程序执行结果为:"hello,andylin"。
#include<iostream>
#include<string.h>
using namespace std;
class mystring
public:
char*pdata;
mystring(int len)
pdata=new char[len+1];
~mystring( )
delete pdata;
void show( )cout<<pdata<<endl;

void fun(mystring**array,int len)
mystring*old=*array;
______
memcpy(*array,old,len);

void main( )
mystring str(20);
mystring*pstr=&str;
mystring**ppstr=&pstr;
strcpy(str.pdata,"hello,andylin");
fun(ppstr,20);
______

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码