首页
试卷库
试题库
当前位置:
X题卡
>
所有题目
>
题目详情
支持子程序调用的数据结构是______。
查看本题答案
包含此试题的试卷
计算机等级考试《简单单选》真题及答案
点击查看
你可能感兴趣的试题
支持子程序调用的数据结构是.
栈
树
队列
二叉树
热门试题
更多
本题程序的功能是随机产生一个1~10的随机数根据提示用户可以猜这个随机数例如程序随机产生的随机数是7如果输入8则提示Trysmaller并继续提示输入如果输出6则提示Trybigger并继续提示输入如果输入7则会输出Great!并退出程序请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.io.*;publicclassbasicpublicstaticvoidmainString[]argsInputStreamReaderit;BurferedReaderin;Ir=newInputStreamReaderSystem.inIn=newBufferedReaderir;intranNum=______;intguessNum=-1;Stringstr;while______System.out.printPleaseInput:;try______;guessNum=Integer.parseIntstr;catchExceptioneifguessNum>ranNumSystem.out.printlnTrysmaller...;elseSystem.out.printlnTrybigger...;System.out.printlnGreat!;
下列表达式中正确的是______
本题程序的功能是使用GridBayLayout来组织窗口上的按钮窗口中共有7个按钮前3个按钮放置在第1排第4个按钮独占第2排第6个按钮位于第3排的右侧而第5和第7个按钮共同处于第3排的左侧请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjavax.swing.*;importjava.awt.*;importjava.awt.event.*;publicclasssimpleextendsJframeprivateJPaneljpanel1=newJPanel;privateGridLayoutg1;privateJButtonJButton1=newJButton第一个;privateJButtonJButton2=newJButton第二个;privateJButtonJButton3=newJButton第三个;privateJButtonJButton4=newJButton第四个;privateJButtonJButton5=newJButton第五个;privateJButtonJButton6=newJButton第六个;privateJButtonJButton7=newJButton第七个;public______supersimple;setSize300150;GridBagLayoutgbl=______;jpanell.setLayoutgbl;GridBagConstraintsgbc=newGridBagConstraints;gbc.fill=GridBagConstraints.BOTH;gbc.gridwidth=1;gbc.gridheight=1;gbc.gridx=0;gbc.gridy=0;jpanell.addJButtonlgbc;gbc.gridx=1;jpanell.addJButton2gbc;gbc.gridx=2;jpanell.addJButton3gbc;gbc.gridx=0;gbc.gridy=1;gbc.gridwidth=3;jpanell.addJButton4gbc;gbc.gridy=2;gbc.gridwidth=1;jpanell.addJButton5gbc;gbc.gridx=1;gbc.gridwidth=2;gbc.gridheight=2;jpanell.addJButton6gbc;gbc.gridx=0;gbc.gridy=3;gbc.gridwidth=1;gbc.gridheight=1;jpanell.addJButton7gbc;this.setContentPanejpanel1;publicstaticvoidmainStringargs[]simplefgl=newsimple;fgl.show;fgl.addWindowListenernewWindowAdapterpublicvoidwindowClosingWindowEventeSystem.exit0;;
在面向对象方法中不属于对象基本特点的是______
本题程序的功能是读入运行程序时所传入的参数一个或多个并将参数依次显示出来例如运行程序lavabasicpar1par2则打印输出为par1par2请将下述程序补充完整注意不得改动程序的结构不得增行或删行publicclassbasicpublicstaticvoidmainString[]argsinti=0;while______System.out.print______+;______;System.out.println;
容器类java.awt.container的父类是______
下列叙述中错误的是______
下列命令中是Java编译命令的是______
本题程序功能是打印1~9的乘法表请将下述程序补充完整注意不得改动程序的结构不得增行或删行publicclassbasicpublicstaticvoidmainString[]args______;fori=i;______;i++forj=i;______;j++System.out.printi+x+j+=+i*j+;System.out.println;
本题程序的功能是通过滑动条修改颜色的RGB值从而控制颜色程序中有一个面板3个标签和3个滑动条标签和滑动条一一对应分别对应三原色红绿蓝任意拖动其中的一个滑动条所对应的颜色值就会发生变化面板的颜色也会对应地发生变化滑动条值的范围是0~255请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;publicclasssimpleextendsJFrameimplementsAdjustmentListenerpublicsimplesetTitlesimple;setSize300200;addWindowListenernewWindowAdapterpublicvoidwindowClosingWindowEventeSystem.exit0;;ContainercontentPane=______;JPanelp=newJPane1;p.setLayoutnewGridLayout32;p.addredLabel=newJLabelRed0;p.addred=newJScrollBarAdjustable.HORIZONTAL000255;red.setBlockIncrement16;red.addAdjustmentListenerthis;p.addgreenLabel=newJLabelGreen0;p.addgreen=newJScrollBarAdjustable.HORIZONTAL000255;green.setBlockIncrement16;green.addAdjustmentListenerthis;p.addblueLabel=newJLabelBlue0;p.addblue=newJScrollBarAdjustable.HORIZONTAL000255;blue.setBlockIncrement16;blue.addAdjustmentListenerthis;contentPane.addpSouth;colorPanel=newJPanel;colorPanel.setBackgroundnewColor000;contentPane.addcolorPanelCenter;publicvoidadjustmentValueChangedAdjustmentEventevtredLabel.setTextRed+red.getValue;greenLabel.setTextGreen+green.getValue;blueLabel.setTextBlue+blue.getValue;colorPanel.setBackgroundnewColorred.getValue.green.getValueblue.getValue;______;publicstaticvoidmainString[]argsJFramef=newsimple;f.show;privateJLabelredLabel;privateJLabelgreenLabel;privateJLabelblueLabel;privateJScrollBarred;privateJScrollBargreen;privateJScrollBarblue;privateJPanelcolorPanel;
本题程序首先给一个数组赋值然后计算该数组中下标为奇数的元素的和请将下述程序补充完整注意不得改动程序的结构不得增行或删行publicclassbasicpublicstaticvoidmainStringargs[]intsum;______;intarrayList[]=newint[20];forinti=0;i<=19;i++arrayList[i]=i+i;intpos=0;whilepos<20if______sum=sum+arrayList[pos];______;System.out.printlnsum=+sum;
下列构造方法的调用方式中正确的是______
下列选项中属于Java语言的垃圾回收机制的一项是______
本题程序的功能是计算圆和三角形的面积通过菜单选择可以分别进行圆和三角形面积的计算单击菜单项圆面积计算窗口中就会显示两个文本框和一个确定按钮在第一个文本框中输入圆的半径单击确定按钮后就可以在第二个文本框中显示圆的面积单击菜单项三角形面积计算窗口中就会显示4个文本框和一个确定按钮在前三个文本框中分别输入三角形三个边的长度单击确定按钮后如果三个边的长度不能组成三角形结果文本框中会给出提示信息否则显示三角形的面积如果输入的值不是数值则会给出提示信息请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;classcircleextendsPanelimplementsAetionListenerdoublerarea;TextFieldradius=nullresult=null;Buttonb=null;______;radius=newTextField10;result=newTextField10;b=newButton确定;addnewLabel输入半径;addradius;addnewLabel面积是;addresult;addb;b.addActionListenerthis;resultsetEnabledfalse;publicvoidactionPerformedActionEventetryr=Double.parseDoubleradius.getText;area=Math.PI*r*r;resultsetText+area;catchExceptioneeradius.setText请输入数字字符;classtriangleextendsPanelimplementsActionListenerdoublea=0b=0c=0area;TextFieldbordera=newTextField6;TextFieldborderb=newTextField6;TextFieldborderc=newTextField6;Result=newTextField24;Buttonbutton=newButton确定;triangleaddnewLabel输入三边的长度;addborder_a;addborder_b;addborder_c;addnewLabel面积是:;addresult;addbutton;buttonaddActionListenerthis;result.setEnabledfalse;publicvoidactionPerformedActionEventetrya=Double.parseDoubleborder_a.getText;b=Double.parseDoubleborder_b.getText;c=Double.parseDoubleborder_c.getText;ifa+b>c&&a+c>b&&c+b>adoublep=a+b+c/2;area=Math.sqrtp*p-a*p-b*p-c;result.setText+area;elseresult.setText您输入的数字不能形成三角形;catchExceptioneeresult.setText请输入数字字符;classWin______implementsActionListenerMenuBarbar=null;Menumenu=null;MenuItemitem1item2;circlecircle;triangletrangle;Winbar=newMenuBar;menu=newMenu选择;setSize300200;item1=newMenuItem圆面积计算;item2=newMenuItem三角形面积计算;menu.additem1;menu.additem2;bar.addmenu;setMenuBarbar;circle=newcircle;trangle=newtriangle;item1.addActionListenerthis;item2.addActionListenerthis;setVisibletrue;publicvoidactionPerformedActionEventeife.getSource==item1removeAll;addcircleCenter;validate;elseife.getSource==item2removeAll;addtrangleCenter;validate;publicclassadvancepublicstaticvoidmainStringargs[]Winwin=newWin;win.setTitleadvance;win.setBounds100100700300;win.setVisibletrue;win.addWindowListener______publicvoidwindowClosingWindowEventeSystem.exit0;;
下列Java组件中不属于容器的是______
本题程序的功能是监听对于列表项的操作窗口中有一个列表和添加删除和关闭三个按钮单击添加按钮会在当前所选列表项后添加一个名为新增表项的列表项同时后台输入列表中的表项数量单击删除按钮如果未选中表项则弹出提示消息框请选择表项否则将选中的表项删除同时后台输出删除表项的内容和列表中的表项数量单击关闭按钮退出程序程序中存在若干错误请找出并改正注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;importjavax.swing.JOptionPane;publicclassadvancepublicstaticvoidmainStringargs[]finalFramefrmFrame=newFrame;PanelpnlPanel1=newPanel;PanelpnlPanel2=newPanel;finalLististList=newList8;forinti=0;i<10;i++StringstrName=表项+newIntegeri+1.toString;istList.addstrName;ButtonbtnButton1=newButton添加;ButtonbtnButton2=newButton删除;ButtonbtnButton3=newButton关闭;btnButton1.addActionListenernewActionListenerpubliCvoidactionPerformedActionEventelstList.add新增表项istList.getSelected+1;System.out.println列表中的表项数量+istListgetItemCount;;btnButton2.addActionListenernewActionListenerpublicvoidactionPerformedActionEventeifistList.getSelected==nullJOptionPane.showMessageDialogfrmFrame请选择表项;return;System.out.println删除表项的内容:+istListgetSelectedItem;istList.deleteistList.getSelectedIndex;System.out.println列表中的表项数量:+istListgetItemCount;;btnButton3.addActionListenernewActionListenerpublicvoidactionPerformedActionEventeSystem.exit0;;pnlPanel1.addistList;pnlPanel2.addbtnButton1;pnlPanel2.addbtnButton2;pnlPanel2addbtnButton3;frmFrame.addNorthpnlPanel1;frmFrame.addSouthpnlPanel2;frmFramesetTitleadvance;frmFrame.pack;frmFrameshow;
本题程序的功能是主窗口中有一个按钮按钮的长和宽每200ms增加1当达到100时又恢复原来大小重新进行增加请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;publicclasssimplepublicstaticvoidmainStringargs[]Mywinwin=newMywin;classMywinextendsFrame______Buttonb=newButton按钮;intx=5;Threadbird=null;MywinsetBounds100100400400;setLayoutnewFlowLayout;setTitlesimple;setVisibletrue;addb;b.setBackgroundColor.green;addWindowListenernewWindowAdapterpublicvoidwindowClosingWindowEventeSystem.exit0;;bird=newThreadthis;bird.start;public______whiletruex=x+1;ifx>100x=5;b.setBounds4040xx;trybird.sleep200;catchInterruptedExceptione
本题程序的功能是监听键盘敲击事件并将敲击的字符显示在标签上开始时文字标签提示Pleasepressyourkeyboard!当按下键盘上的字符键时文字标签就变为’X’ispressed!X代表用户按下的键所代表的字符请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;publicclasssimpleextendsFrame______publicstaticvoidmainStringargs[]simplef=newsimplesimple;Panelpan=newPanel;f.init;publicsimpleStringstrsuperstr;publicvoidinitaddWindowListenernewWindowAdapterpublicvoidwindowClosingWindowEventeSystem.exit0;;setSize200200;setLayoutnewFlowLayout;lab=newLabelPleasepressyourkeyboard!;addlab;addKeyListenerthis;setVisibletrue;publicvoidkeyTypedKeyEventelab.setText/’+______+/’ispressed!;repaint;publicvoidkeyPressedKeyEventepublicvoidkeyReleasedKeyEventeprivateLabellab;
对象状态的持久化是通过______实现的
用于输入压缩文件格式的ZipInputStream类所属包是______
本题程序的功能是用键盘上的方向键来控制直线的绘制方向如果一直按向上的方向键则在窗口中从焦点开始向上缓慢绘制直线按其他方向的方向键也会向对应的方向缓慢地绘制直线如果按下Shift键绘制直线的速度会加快请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.geom.*;importjava.util.*;importjava.awt.event.*;importjavax.swing.*;publicclassadvancepublicstaticvoidmainString[]argsSketchFrameframe=newSketchFrame;frame.setDefaultCloseOperationJFrame.EXITONCLOSE;frameshow;classSketchFrameextendsJFramepublicSketchFramesetTitleadvance;setSizeDEFAULT_WIDTHDEFAULT_HEIGHT;SketchPanelpanel=newSketchPanel;ContainercontentPane=getContentPane;contentPane.addpanel;publicstaticfinalintDEFAULT_WIDTH=300;publicstaticfinalintDEFAULT_HEIGHT=200;classSketchPanelextendsJPanel______;last=newPoint2D.Double100100;lines=newArrayList;KeyHandlerlistener=newKeyHandler;______;setFocusabletrue;publicvoidaddintdxintdyPoint2Dend=newPoint2D.Doublelast.getX+dxlast.getY+dy;Line2Dline=newLine2D.Doublelastend;lines.addline;repaint;last=end;publicvoidpaintComponentGraphicsgsuper.paintComponentg;Graphics2Dg2=Graphics2Dg;forinti=0;i<lines.size;i++g2.drawLine2Dlines.geti;privatePoint2Dlast;privateArrayListlines;privatestaticfinalintSMALLINCREMENT=i;privatestaticfinalintLARGE_INCREMENT=5;privateclassKeyHandlerimplementsKeyListenerpublicvoidkeyPressedKeyEventevent______;intd;ifevent.isShiftDownd=LARGE_INCREMENT;elsed=SMALL_INCREMENT;ifkeyCode==KeyEvent.VK_LEFTadd-d0;elseifkeyCode==KeyEvent.VK_RIGHTaddd0;elseifkeyCode==KeyEvent.VK_UPadd0-d;elseifkeyCode==KeyEvent.VKDOWNadd0d;publicvoidkeyReleasedKeyEventeventpublicvoidkeyTypedKeyEventeventcharkeyChar=event.getKeyChar;intd;ifCharaeter.isUpperCasekeyChard=LARGE_INCREMENT;keyChar=Character.toLowerCasekeyChar;elsed=SMALL_INCREMENT;
在数据管理技术发展的三个阶段中数据共享最好的是______
本题程序的功能是用表格的形式列出当前目录所有的文件属性包括是否是文件夹文件名称是否可读是否可写文件大小以及最后修改时间程序中存在若干错误请找出并改正注意不得改动程序的结构不得增行或删行importjava.awt.*;importjavax.swing.*;importjava.util.Date;importjava.io.File;importjavax.swing.table.*;publicclassadvanceextendsJframepublicadvancesuperadvance;setSize500400;setDefaultCloseOperationEXIT_ON_CLOSE;FileModelfm=newFileModel;JTablejt=newJTablefm;jt.setAutoResizeModeJTable.AUTO_RESIZE_OFF;jt.setColumnSelectionAllowedtrue;jt.setDefaultRendererNumber.classnewBigRenderer1000;JScrollPanejsp=newJScrollPanejt;getContentPane.addjspBorderLayout.CENTER;publicstaticvoidmainStringargs[]advanceft:newadvance;ft.setVisibletrue;classBigRendererextendsDefaultTableCellRendererdoublethreshold;publicBigRendererdoubletthreshold=t;setHorizontalAlignmentJLabel.RIGHT;setHorizontalTextPositionSwingConstants.RIGHT;publicComponentgetTableCellRendererComponentJTabletableObjectvaluebooleanisSelectedbooleanhasFocusintrowintcolreturnsuper.getTableCellRendererComponenttablevalueisSelectedhasFocusrowcol;classFileModelextendsAbstractTableModelStringtitles[]=newString[]目录文件名可读可写大小最后修改时间;Classtypes=newClass[]Boolean.classString.classBoolean.classBoolean.classNumber.classDate.class;Objectdata[][];publicFileModelthis.;publicFileModelStringdirFilepwd=newFiledir;setFileStatspwd;publicintgetRowCountreturndata.length;publicintgetColumnCountreturntitles.length;publicStringgetColumnNameintcreturntitles[c];publicClassgetColumnClassintcreturntypes[c];publicvoidgetValueAtintrintcreturndata[r][c];publicvoidsetFileStatsFiledirStringfiles[]=dir.list;Data=newObject[files.length][titles.length];forinti=0;i<files.length;i++Filetmp=newFilefiles[i];data[i][0]=newBooleantmp.isDirectory;data[i][1]=tmp.getName;data[i][2]=newBooleantmp.canRead;data[i][3]=newBooleantmp.canWrite;data[i][4]=newLongtmp.length;data[i][5]=newDatetmp.lastModified;fireTableDataChanged;
在长度为z的有序线性表中进行二分查找最坏情况下需要比较的次数是______
在Java中用package语句说明一个包时该包的层次结构必须是______
本题程序的功能是求两个交叉图形的并减交及异或窗口中有4个单选按钮和一个图形面板面板中有两个交叉的图形选中其中一个单选按钮图形面板中会以黑色填充的方式显示运算的结果请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;importjava.awt.geom.*;importjava.util.*;importjavax.swing.*;publicclassadvancepublicstaticvoidmainString[]argsJFrameframe=newAreaTestFrame;frame.setDefaultCloseOperationJFrame.EXIT_ON_CLOSE;frame.show;classAreaTestFrameextendsJFramepublicAreaTestFramesetTitleadvance;setSizeWIDTHHEIGHT;area1=newAreanewEllipse2D.Double100100150100;area2=newAreanewRectangle2D.Double150150150100;______;panel=newJPanelpublicvoidpaintComponentGraphicsgsuper.paintComponentg;Graphics2Dg2=Graphics2Dg;g2.drawarea1;g2.drawarea2;ifarea!=nullg2.fillarea;contentPane.addpanelBorderLayout.CENTER;JPanelbuttonPanel=newJPanel;ButtonGroupgroup=newButtonGroup;JRadioButtonaddButtoh=newJRadioButton并false;buttonPanel.addaddButton;group.addaddButton;addButton.addActionListenernewActionListenerpublicvoidactionPerformedActionEventeventarea=newArea;area.addarea1;area.addarea2;panel.repaint;;JRadioButtonsubtractButton=newJRadioButton减false;buttonPanel.addsubtractButton;group.addsubtractButton;subtractButton.addActionListenernewActienListenerpublicvoidactionPerformedActionEventeventarea=newArea;area.addareal;______;panel.repaint;;JRadioButtonintersectButton=newJRadioButton交false;buttonPanel.addintersectButton;group.addintersectButton;intersectButton.addActionListenernewActionListenerpublicvoidactionPerformedActionEventeventarea=newArea;area.addarea1;area.intersectarea2;panel.repaint;;JRadioButtenexclusiveOrButton=newJRadioButton异或false;buttonPanel.addexclusiveOrButton;group.addexclusiveOrButton;exclusiveOrButton.addActionListenernewActionListenerpublicvoidactionPerformedActionEventeventarea=newArea;area.addarea1;______;panelrepaint;;contentPane.addbuttonPanelBorderLayout.NORTH;privateJPanelpane1;privateAreaarea;privateAreaarea1;privateAreaarea2;privatestaticfinalintWIDTH=400;privatestaticfinalintHEIGHT=400;
数据流图中带有箭头的线段表示的是______
本题程序的功能是主窗口有一个按钮一个文本域和一个复选框初始时窗口的大小是不能调整的勾选复选框后窗口大小就可以进行调整如果取消勾选复选框则窗口的大小又不能调整单击按钮可以关闭程序请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.awt.*;importjava.awt.event.*;classMyFrameextendsFrame______Checkboxbox;TextAreatext;Buttonbutton;MyFrameStringssupers;box=newCheckbox设置窗口是否可调整大小;text=newTextArea1212;button=newButton关闭窗口;button.addActionListenerthis;box.addItemListenerthis;setBounds100100200300;setVisibletrue;addtextBorderLayout.CENTER;addboxBorderLayout.SOUTH;addbuttonBorderLayout.NORTH;______;validate;publicvoiditemStateChangedItemEventeifbox.getState==truesetResizabletrue;elsesetResizablefalse;publicvoidactionPerformedActionEventedispose;classsimplepublicstaticvoidmainStringargs[]newMyFramesimple;
一个栈的初始状态为空现将元素12345ABCDE依次入栈然后再依次出栈则元素出栈的顺序是______
本题程序的功能是将输入的字符串转换为实数并打印输出请将下述程序补充完整注意不得改动程序的结构不得增行或删行importjava.io.*;publicclassbasicpublicstaticvoidmainString[]argsInputStreamReaderir;BufferedReaderin;Ir=newInputStreamReader______;in=newBufferedReaderir;doubled=0.0;System.out.print请输入一个实数:;______Strings=in.readLine;______catchExceptioneSystem.out.println你输入的实数是:+d;
热门题库
更多
计算机操作系统
软件测试工程师
计算机等级考试
法宣在线考试
司法卷一
司法卷二
司法卷三
司法卷四
企业法律顾问资格考试
“十三五”规划继续教育
潜力激活与创造力开发继续教育
创新创业能力继续教育
科研方法与论文写作继续教育
全面深化改革实现文明发展
提高自身绩效路径与方法
互联网监管与网络道德建设