好文档 - 专业文书写作范文服务资料分享网站

java复习题52070 

天下 分享 时间: 加入收藏 我要投稿 点赞

(true); }

public static void main(String arg[]) {

new LoginFrame(); } }

问:(1)该程序中用到哪些组件,写出它们的中文名称。

(2)程序中用到哪种类型的布局管理器,该种布局管理器是如何对组件布局的

15. 分析下面的程序,回答问题 import .*;

class FileInputStreamDemo {

public static void main(String[] args) {

String filename; int ch = 0;

filename = \

}

问:程序的功能是什么, import .*;

}

try {

FileInputStream fis = new FileInputStream(filename); while ((ch = ()) != -1) { } ();

ch);

} catch (IOException e) { }

\

public class FileOutputStreamDemo {

public static void main(String[] args) throws IOException { int n = 0; int num = 0; int i = 0;

String filename = \ FileOutputStream fos = null; FileInputStream fis = null; try {

fos = new FileOutputStream(filename,true); for (n =100;n<=200;n++){ if (n % 3 ==0){

i++;

String str = (n); String str1 = str+\ \byte[] buff = (); (buff); if(i==0){ str = \byte[] buf = (); (buf) }

}

} ();

catch (FileNotFoundException e1) {

}

catch (IOException e2) { }

}

}

问:程序的功能是什么

1. 用递归调用求Fibonacci数的前5个数,(1,1,2,3,5)请将下面的程序填写完整。

public class Fibo {

public static void main(String args[]) { }

long f(long n){ if( )return 1; else return ; }

2. 请写出下面程序的运行结果 public class Test extends TT {

public void main(String args[]) {

Test t=new Test(\ }

public Test(String s) {

}

public Test()

super(s); \

final int n = ; for(int i = 1;i <= n;i++) {

\ ); if(i % 10 == 0)

}

}

{ }

this(\

class TT {

public TT( ) { }

public TT(String s ) { } }

结果

3. 构造方法的使用,计算长,宽分别为20,6的长方形面积,将下面的程序填写完整。 class RectConstructor {

double length; double width; double area() {

}

return ;

this( ); \

\

RectConstructor(double width,double length) {

; ;

}

}

class RectDemo {

public static void main(String args[]) {

rect1=new RectConstructor( );

double ar; ar = ();

\长方形的面积是: \

} }

4.如果下面的方法能正常运行,则该程序的运行结果是 , , 。 public void example( ) { try { }

catch(safeException e) { }

\

unsafe( ); \

java复习题52070 

(true);}publicstaticvoidmain(Stringarg[]){newLoginFrame();}}问:(1)该程序中用到哪些组件,写出它们的中文名称。(2)程序中用到哪种类型的布局管理器,该种布局管理器是如何对组件
推荐度:
点击下载文档文档为doc格式
65k1i8f1791lh1d7s0l19lpyv23wp8008id
领取福利

微信扫码领取福利

微信扫码分享