( 20 )在下列程序的空白处,应填入的正确选项是import java.io.*;Public class writeInt{Public static void main(string[ ] a) {Int[ ] myArray = {10,20,30,40};try{DataOutputSystem dos= new DataOutputSystem( new FileOutputSystem( “ ints.dat ” ) ) ;for ( int i=0 ; ImyArray.length ; i++ )dos 。 writeInt ( myArray[i] ) ;dos.System.out.println( “ Have written binary file ints.dat ” );}Catch(IOException ioe){ System.out.println( “ IO Exception ” );}}}A)start( )B)close( )C)read( )D)write( )
( 20 )在下列程序的空白处,应填入的正确选项是
import java.io.*;
Public class writeInt{
Public static void main(string[ ] a) {
Int[ ] myArray = {10,20,30,40};
try{
DataOutputSystem dos= new DataOutputSystem
( new FileOutputSystem( “ ints.dat ” ) ) ;
for ( int i=0 ; I<myArray.length ; i++ )
dos 。 writeInt ( myArray[i] ) ;
dos.
System.out.println
( “ Have written binary file ints.dat ” );
}
Catch(IOException ioe)
{ System.out.println( “ IO Exception ” );
}
}
}
A)start( )
B)close( )
C)read( )
D)write( )
相关考题:
下列是定义一个接口ITF的程序,在横线处应填入的选项是 ( )public interface ITF{public static final double PI=3.14,public ______ double area(double a,double b);}A.interfaeeB.staticC.finalD.abstract
下列是定义一个接口ITF的程序,在横线处应填入的选项是 ( ) public interface ITF { public static final double PI=3.14; public( )double area(double a,double b); }A.interfaceB.staticC.finalD.abstract
下列是定义一个接口ITF的程序,在横线处应填入的选项是( )。 publid interface ITF { public static final double PI=3.14; public______double area(double a,double B) ; }A.interfaceB.staticC.finalD.abstract
在下列程序画线处填入的正确语句是()。includeusing namespace std;classBase{public: 在下列程序画线处填入的正确语句是( )。 #include <iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun",<<end1; } }; class Derived:public Base { void fun() { ______________ //显式调A.fun();B.Base.fun();C.Base::fun();D.Base->fun();
下列是定义一个接口ITF的程序,在横线处应填入的选项是 pubic interface ITF { public static final double PI=3.14; public________ double area(double a,double b); }A.interfaceB.staticC.finalD.abstract
下列是定义一个接口ITF的程序,在横线处应填入的选项是( )。 public interface ITF { public static final double PI=3.14; public ______ double area(double a,double b); }A.interfaceB.staticC.finalD.abstract
在下列程序的空白处,应填入的正确选项是( )。 importjava.io.*; Public class writeInt{ Public static void main(string[]a){ Int[]myArray=(10,20,30,40); try{ DataOutputSystem dos=new DataOutputSystem (new FileOutputSystem("ints.dat")); for(int i=0;lMYARRAY.LENGTH;I++) dos.writeInt(myArray[i]); dos. ; System.Out.println ("Have written binary file ints.dat"); } Catch(IOException ioe) {System.out.println("IO Exception"), } } }A.startB.closeC.readD.write