The public store is to close at 9:30 p.m. ()no need to worry; it is just 7:30 p.m.
第1题:
下列______选项不是InputStream类中的方法。
A.public abstract int read() throws IOException
B.public final void writeInt (int V)throws IOException
C.public int available() throws IOException
D.public void close() throws IOException
第2题:
选择正确的语句填在下列程序的横线处,使程序正常运行。 package ch1; import java. io. *; import j ava. util. *; class C45 implements Seritizable ______Public Thread t = new Thread(new T45(), "t"); public intcnt = 0; public C45() { t. start ( ) class T45 implements Runnable public int[] a = new int[4]; public void run() { for(int i - 0; i < 4; i++) { a[i] - i +4; } } } public class ex45 { static String fileName = "ch1\\file45.txt"; public static void main(String[] args) throws Exception { C45 bj = new C45 (); FileOutputStream fos = new FileOutputStream(fileName); ObjectOutputStream os = new ObjectOutputStream(fos); oos. writeObject (obj); oos.clese (); fos.close (); System. out, println (obj . toString ( ) ); } }
A.transient
B.protected
C.package
D.final
第3题:
请完善程序(程序文件名:Java_3.java)并进行调试。请在下画线处填入正确内容,然后删除下画线。请勿删除注释行和其他已有的语句内容。
[题目要求]
生成下面左边图形界面,单击图中的New按钮,弹出如右图所示的对话框。
源程序:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Java_3 {
public static void main(String[] args) {
MulticastFrame. frame=new MulticastFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}
class MulticastFrame. extends JFrame. {
public MulticastFrame() {
setTitle("MulticastTest");
setSize(WIDTH,HEIGHT);
MulticastPanel panel=new MulticastPanel();
Container contentPane=getContentPane();
contentPane.add( (1) );
}
public static final int WIDTH=300;
public static final int HEIGHT=200;
}
class MulticastPanel extends JPanel }
public MulticastPanel() {
JButton newButton=new JButton("New");
add(newButton);
ActionListener newListener=new ActionListener() {
public void actionPerformed(ActionEvent event) {
makeNewFrame();
}
};
newButton.addActionListener(newListener);
closeAllButton=new JButton("Close all");
add(closeAllButton);
}
private void makeNewFrame() {
final BlankFrame. frame=new BlankFrame();
frame.show();
ActionListener closeAllListener=new ActionListener() {
public void actionPerformed(ActionEvent event) {
frame. (2) (); //使窗口隐藏或消除
}
};
closeAllButton.addActionListener( (3) );
}
private JButton closeAllButton;
}
Class BlankFrame. extends JFrame. {
public BlankFrame() {
(4) ++;
setTitle("Frame"+counter);
setSize(WIDTH,HEIGHT);
setLocation(SPACING*counter,SPACING*counter);
}
public static final int WIDTH=200;
public static final int HEIGHT=150;
public static final int SPACING=30;
private static int counter=0;
}
第4题:
本题中,生成一个窗口,该窗口的长、宽为屏幕长、宽的一半,并且窗口的大小不能改变。
import java.awt.*;
import javax.swing.*;
public class java2
{
public.static void main(String[]args)
{
FrameSize frame=new FrameSize();
frame.setDefaultCloseoperation(JFrame.EXIT
ON_CLOSE);
frame.show();
}
}
class FrameSize extends JFrame
{
public FrameSize()
{
setTitle("java2");
Toolkit tk=Toolkit.getDefaultToolkit();
Dimension screenSize=
int screenHeight=screenSize.height;
int screenWidth=screenSize.width;
setSize(screenWidth/2,sereenHeight/2);
;
}
第5题:
A public company that fails to obey the new law could be forced to( )
[A] pay a heavy fine
[B] close down its business
[C] change to a private business
[D] sign a document promising to act
第6题:
Many()shops will be forced to close if the new supermarket is built.
第7题:
用于声明所有变量是私有变量的命令是()
第8题:
Which WebSphere Commerce model demonstrates the RFQ process?()
第9题:
import java.io.*; public class Forest implements Serializable { private Tree tree = new Tree(); public static void main(String [] args) { Forest f= new Forest(); try { FileOutputStream fs = new FileOutputStream(”Forest.ser”); ObjectOutputStream os = new ObjectOutputStream(fs); os.writeObject(f); os.close(); } catch (Exception ex) { ex.printStackTrace(); } } } class Tree { } What is the result?()
第10题:
before TDC and close after BDC
after TDC and close after BDC
before TDC and close before BDC
after TDC and close before BDC
第11题:
Implementation a.
Implementation b.
Implementation c.
Implementation d.
Implementation e.
第12题:
You have
They have
It is
There is
第13题:
下列程序将类C15的对象写入文件filetxt,选择正确的语句填入下列程序的横线处。 package ch2; import java.util.*; import java.io.*; class C15______ { public iht a; public void setInt(int newa) { a = newa; } } public class Testl5 { pulibc static void main(String[] args) { C15 bj = new C15(); try { FileOutputStream fos =newFileOutputStream("ch2\\filel5.txt"); ObjectOutputStream os = ObjectOutputStream(fos); Obj.setInt(10); oos.writeObject(obj); oos.close (); fos.close(); } catch(IOException ioe) { ioe.printStackTrace(); } } }
A.implements Runnable
B.implements Sedalizable
C.extends Serializable
D.implements InputStream
第14题:
从对象流中读取对象,请在下面横线处填写代码完成此程序。
import java.util. *;
import java. io. *;
public class UnSerializeDate
{
date d = null;
UnSerializeDate ( )
{
try
{
FileInputStream f1 = new FileInputStream("date.ser");
d = (Date) s. readobject ();
f1,close();
}
catch (Exceptin e)
{
e. printStackTrace ();
}
}
public static main(String args [] )
{
System.out.println("The date read is: "+ a.d.toString());
}
}
第15题:
下列程序将Date对象写入文件file42.txt中,选择正确的语句填入下列程序中的横线处。 package ch1; impbrt java. io. *; import java. util. *; public class ex42 { static String fileName = "ch1\\file42.txt"; static Date date = null; public static void main(String[] args) { date = new Date(); try { FileOutputStream fos = new FileOutputStream(file Name); ObjectOutStream os = new ObjectOutputStream(fos); oos.______; oos.close(); fos.close(); System.out.println(date.toString()); } catch(Exception e) { System.out.println(e.getMessage()); } } }
A.writeObject()
B.writeObject(date)
C.write(date)
D.writeByte(date)
第16题:
下列哪个选项不是InputStream类中的方法?
A.public abstract int read( )throws IOException
B.public final void writeInt(int v)throws IOException
C.pubfic void close( )throws IOException
D.pubfic int available( )throws IOExcepfion
第17题:
The public store is to close at 9:30 p.m. ()no need to worry; it is just 7:30 p.m.
AYou have
BThey have
CIt is
DThere is
第18题:
不打开任何表,在VFP命令窗中能执行以下命令,产生错误的是()。
第19题:
下列赋值语句中正确的是()
第20题:
A developer chooses to avoid using SingleThreadModel but wants to ensure that data is updated in athread-safe manner. Which two can support this design goal?()
第21题:
You have an Exchange Server 2010 that contains five mailbox servers.Mailbox server Server1 host a mailbox database named DB1.DB1 contains 300 user mailboxes.You create a new public folder database named Public2 on Server1.You need to ensure that all users that have mailboxes in DB1 store new public folders in Public2. What should you do?()
第22题:
Consumer direct store model
Advanced B2B direct store model
Demand chain store model
Advanced Demand chain store model
Marketplace hub store model
第23题:
later and close sooner
sooner and close later
sooner and close sooner
later and close later
第24题:
close Fan and Humidifier at the same time
firstly close Fan and then close humidifier immediately
firstly close humidifier and then close Fan immediately
firstly close humidifier and then close Fan after 30 seconds