题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-05 02:28:09

[填空题]下面是用户程序对Applet 类中方法paint ( )的重新定义,根据程序功能,在指定的空白处填上适当的语句或语法成分。
public void paint (Graphics g)
g 【9】 (“你好!”,10,20);

更多"下面是用户程序对Applet 类中方法paint ( )的重新定义,根"的相关试题:

[填空题]下面是用户程序对Applet类中方法paint( )的重新定义。根据程序功能,在指定的空白处填上适当的语句或语法成分。
public void paint (Graphics g)
  g. ______ (“你好!”,10,20);
[填空题]下列程序实现的功能是当按下键盘时,在Applet中通过paint( )方法,在(50,50)位置处显示出按下的键的名称。在横线处填写正确的语句。
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Test7 extends Applet

String str="";
public void init( )

addKeyListener (new KeyAdapter( )

public void keyPressed(KeyEvent ke)

【16】 ;
repaint( );

);
requestFocus( );

public void paint(Graphics g)

g.drawString("你按下的键是:" +str, 50,50);


[单项选择]下面程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是
public class FindKeyWords
 public static void main(String[]args)
  String text="An array is a data structur that stores a collection of"
        +"values of the same type. You access each indMdual value"
        +"through an integer index. For example,if a is an array"
        +"of inergers,then a[i]is the ith integer in the array.";
  int arrayCount=0;
  int index=-1;
  String arrayStr="array";
  index=text.indexOf(arrayStr);
  while(index>=0)
   ++arrayCount;
   index+=arrayStr.length( );
   index=text.indexOf(arrayStr,index);
  
  System.out.println("the text contains"+arrayCount+"arrays");
 

A. <
B. =
C. <=
D. >=
[填空题]空白处应该填写的程序为 【7】
[填空题]空白处应该填写的程序为 【6】
[填空题]在下面程序的空白处,填上适当的内容。
Import java.io. *:
import java.util. *;
class BufferTest
 public static void main(String args[])throws IOExeeption
  FileOutputStream unbuf=new FileoutputStream("test.one");
  BufferedOutputStream bur=new ______ (new FileOutputStream("test.two"));
  System.out.println("write file unbuffered:"+time(unbuf)+"ms");
  System.out.println("write file buffered:"+time(buf)+"ms");

static int time(OutputStream os)throws IOException
 Date then=new Date( );
 for(int i=0;i<50000;i++)os.write(1);
 os.close( );
 return(int)((new Date( )).getTime( )-then.getTime( ));
 

[填空题]在程序的空白处填写适当的语句(一个空白处只能填写一条语句),使程序完成相应的数据处理。Form_Load事件过程给数组赋初值35,48,15,22,67。Form_Click事件过程对数组元素进行处理。
DimA rr(1 To 5)
Private Sub Form_Load( )
[11]
End Sub
Private Form_Click( )
[12]
If Int(x/3)=x/3 Then
PrintX
End If
Next X
End Sub

[单项选择]在下面程序的空白处,应填入的正确选项是
import java.io.*;
public class ObjectStreamTest
 public static void main(String args[])throws IOExeeption
  ObjectoutputStream oos=new ObjectOutputStream(new FileOutputStream("serial.bin"));
  java.util.Date d=new java.util.Date( );
  oos. ______(d);
  ObjectInputStream ois=new ObjecttInputStream(new FileInputStream("serial.bin"));
  try
   java.util.Date restoredDate=(java.util.Date)ois.readObject( );
   System.out.println("read object back from serial.bin file:"+restoredDate);
   catch(classNotFoundException cnf)
   System.out.println("class not found");
  
 

A. WriterObject
B. write
C. BufferedWriter
D. writerObject

我来回答:

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

订单号:

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