题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-06-27 21:07:27

[填空题]下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。 import javax.swing.*; public class OneTeam extends JFrame { JRadioButton[] teams = new JRadioButton[3]; public OneTeam( ) { super("One Team"); setSize (140,160); setDefaultCloseOperation(JFrame.EXIT ON CLOSE JPanel pane = new JPanel( ); teams[0] = new JRadioButton("red choose"); teams[l] = new JRadioButton("blue choose"); teams[2] = new JRadioButton("green choose"); 【11】 ; for ( int i = 0;i < teams.length;i++) { group.add(teams[i]); pane.add(teams[i]); } setContentPane(pane); } public static void main(String arguments[] { OneTeam ot= new OneTeam( ); ot.show( ); }

更多"下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句"的相关试题:

[填空题]下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。
import javax.swing.*;
public class OneTeam extends JFrame

JRadioButton[] teams = new JRadioButton[3];
public OneTeam( )

super("One Team");
setSize (140,160);
setDefaultCloseOperation(JFrame.EXIT ON CLOSE
JPanel pane = new JPanel( );
teams[0] = new JRadioButton("red choose");
teams[l] = new JRadioButton("blue choose");
teams[2] = new JRadioButton("green choose");
【11】 ;
for ( int i = 0;i < teams.length;i++)

group.add(teams[i]);
pane.add(teams[i]);

setContentPane(pane);

public static void main(String arguments[]

OneTeam ot= new OneTeam( );
ot.show( );

[填空题]在下面程序的下画线处,填入适当的语句使程序能正确执行并输出异常栈信息。
public class ThrowableException
 public static void main(String args[])
  try
   throw new Throwable("这里是本人定义的异常");
   catch(Throwable e)
    System.out.println("Caught Throwable");
    System.out.println("e.getMessage( ):"+e.getMessage( ));
    System.out.println("e.toString( ):"+e.toString( ));
    System.out.println("e.printStackTrace( ):");
    ______
  
 

[填空题]在下列程序的下画线处,填入适当语句使程序能正确执行并输出异常栈信息。
Public class ThrowableException
Public static void main (String args[])
try
throw new Throwable("这里是本人定义的异常");
catch(Throwable e)
System.out.printIn("Caught Throwable");
System.out.printIn("e.getMessage( ):"+e.getMessage( ));
System.out .printIn("e.toString( ):"+e.toString( ));
System.out.printin("e.printStackTrace( ):");
______;)
[单项选择]在下面的定义语句中,画线处应填入的内容是
class Fred
public:
void print( )cout<<data<<endl;
void setData(double D) data=d;
static int count;
private:
double data;

______count=0;//静态数据成员的定义
A. int
B. static int
C. int Fred::
D. static int Fred::
[填空题]下面程序构造了一个Swing Applet,在下画线处填入正确的代码。
import javax.swing.*;
import java.awt.*;
public class SwingApplet extends ______
 JLabel 1=new JLabel("This is a Swing Applet.");
 public void init( )
  Container contentPane=getContentPane( );
  contentPane.add(1);
 

[单项选择]依次填入下面一段话中画线处的标点,恰当的一组:
“画人画鬼高人一等,刺贪刺虐入骨三分”______这是郭沫若为蒲松龄纪念馆聊斋堂写的对联。“画人画鬼”,指《聊斋志异》的题材内容______它借狐鬼故事来达到“刺贪刺虐”的目的;“高人一等”,是评价蒲松龄在文学史上的贡献:“入骨三分”,则概括了他在创作上的成就。今天这节课要学习他的名篇______促织______,让我们来看看这个评价是否恰当______
A. ,,《》。
B. 。;“”。
C. ,;《》
D. 。,“”
[填空题]在下面Java Applet程序的下画线处填入代码,使程序完整并能够正确运行。 import java.applet.*; import java.awt.*; public class HelloWorld ______ {  public void paint(Graphics g) {   g.drawString("Hello World!",25,25);  } }
[单项选择]在下面程序的下画线处应填入的选项是
public class Test______
 public static void main(String args[])
  Test t=new Test( );
  Thread tt=new Thread(t);
  tt.start( );
 
 public void run( )
  for(int i=0;i<5;i++) System.out.println("i="+i);
 

A. implements Runnable
B. extends Thread
C. implements Thread
D. extends Runnable
[填空题]在下面Java Applet程序的下画线处填入代码,使程序完整并能够正确运行。
import java.applet.*;
import java.awt.*;
public class HelloWorld ______
 public void paint(Graphics g)
  g.drawString("Hello World!",25,25);
 

[单项选择]在下面程序的下画线处应填入的选项是 public class Test______{  public static void main(String args[]) {   Test t=new Test( );   Thread tt=new Thread(t);   tt.start( );  }  public void run( ) {   for(int i=0;i<5;i++) System.out.println("i="+i);  } }
A. implements Runnable
B. extends Thread
C. implements Thread
D. extends Runnable
[填空题]下面程序的功能是统计命令行参数的个数,在下画线处填上适当的代码。 public class Length {  public static void main(string args[]) {   System.out.println("number of String args:"+args.______);  } }
[填空题]下面程序的功能是统计命令行参数的个数,在下画线处填上适当的代码。
public class Length
 public static void main(string args[])
  System.out.println("number of String args:"+args.______);
 

[填空题]在下面程序的画线处填上适当的内容,使程序执行后的输出结果为ABCD。
#include <iostream>
using namespace std;
class A
public:A( )cout<<’A’;

class B: (11)
public:B( )cout<<’B’;

class C:// (12)
public:C( )cout<<’C’;

class D://public B,public C
public:D( )cout<<’D’;

void main( )
D( );
cout<<endl;


[单项选择]下面程序的功能是将一个整数数组写入二进制文件。在下画线处应填入的选项是 import java.io.*; public class XieShuzu {  public static void main(String[] a) {   int[]myArray={10,20,30,40};   try {    DataoutputStream dos=new DataOutputStream(new FileoutputStream("ints.dat"));    for(int i=0;i<myArray.1ength;i++)dos.______(myArray[i]);    dos.close( );    System.out.println("已经将整数数组写入二进制文件:ints.dat");   } catch(IOException ice) {    System.out.println("IO Exception");   }  } }
A. writeArray
B. writeByte
C. writeInt
D. writeDouble
[填空题]在下面程序的画线处填上适当的内容,使程序执行后的输出结果为1/2005。
#include <iostream>
using namespace std;
class Date
public:
Date(int m=1,int y=0):month(m),year(y)
void Print( )cout<<month<<"/"<<year<<endl;
(9) operator+(const Date&dl,const Date& d2);
private:
int month,year;

(10) operator+(const Date& dl,const Date& d2)
int year,month;
year=d1.year+d2.year;
month=d1.month+d2.month;
year+=(month-1)/12;
month=(month-1)%12+1;
return Date(month,year);

void main( )
Date dl(3,2004),d2,d3(10);
d2=d3+dl;
d2.Print( );


我来回答:

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

订单号:

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