1
(1) FileInputStream
(2) char buf;
(3) (char) fis1.read()
(4) while ((buf = (char) fis2.read()) > 0) System.out.print((char) buf);
fis1.close();
(5)catch (FileNotFoundException e)
你題目抄的有點(diǎn)問題 附上可執(zhí)行源碼
public class SequenceInputStreamDemo {
public static void main(String[] args) {
// _______(1)___________fis1,fis2;
FileInputStream fis1,fis2;
try {
fis1 = new FileInputStream("prog1.java");
fis2 = new FileInputStream("prog2.java");
// _________(2)___________;
char buf;
// while((buf=________(3)_________)>0) System.out.print((char)buf);
while ((buf = (char) fis1.read()) > 0) System.out.print((char) buf);
// ________(4)_______;
while ((buf = (char) fis2.read()) > 0) System.out.print((char) buf);
fis1.close();
fis2.close();
// }________(5)_________{
} catch (FileNotFoundException e) {
System.out.println(e);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
2
(1) 什么也不填
(2) super();
(3) 什么也不填
(4) .indexOf(" ");
(5)i > 0
可執(zhí)行代碼:
public class Name {
private String useName;
private String useS;
// public _______(1)Name{
public Name() {
// _______(2) useName =”whatever”; useS=”whatever”;}
super();
useName = "whatever";
useS = "whatever";
}
// public _______(3)Name (String s)
public Name(String s) {
// {int i=s._______(4)___________;//搜索空格
int i = s.indexOf(" ");
// if(_______(5)___________){
if (i > 0) {
useName = s.substring(0,i);
useS = s.substring(i + 1);
}
}
}
1、編寫一個(gè)程序,將兩個(gè)Java程序文件顯示到屏幕上.
1、編寫一個(gè)程序,將兩個(gè)Java程序文件顯示到屏幕上.
import java.io.*;
public class SequenceInputStreamDemo{
public static void main(String args[]){
_______(1)___________fis1,fis2;
try{
fis1=new FileInprtStream(“prog1.java”);
fis2=new FileInprtStream(“prog2.java”);
_________(2)___________;
while((buf=________(3)_________)>0) System.out.print((char)buf);
________(4)_______;
fis2.close();
}________(5)_________{
System.out.println(e);
}
2.完成下列程序.
public class Name{
private String useName;
private String useS;
public _______(1)Name{
_______(2) useName =”whatever”; useS=”whatever”;}
public _______(3)Name (String s)
{int i=s._______(4)___________;//搜索空格
if(_______(5)___________){
useName=s.substring(0,i);
useS=s.substring(i+1);}}}
3、定義一個(gè)Demo執(zhí)行類.要求可根據(jù)客戶不同要求計(jì)算出矩形、圓的周長和面積.
4、編寫程序,使界面中包含3個(gè)標(biāo)簽,其背景分別為紅、黃、藍(lán)3色
5、實(shí)現(xiàn)文件的復(fù)制,并輸出.
import java.io.*;
public class SequenceInputStreamDemo{
public static void main(String args[]){
_______(1)___________fis1,fis2;
try{
fis1=new FileInprtStream(“prog1.java”);
fis2=new FileInprtStream(“prog2.java”);
_________(2)___________;
while((buf=________(3)_________)>0) System.out.print((char)buf);
________(4)_______;
fis2.close();
}________(5)_________{
System.out.println(e);
}
2.完成下列程序.
public class Name{
private String useName;
private String useS;
public _______(1)Name{
_______(2) useName =”whatever”; useS=”whatever”;}
public _______(3)Name (String s)
{int i=s._______(4)___________;//搜索空格
if(_______(5)___________){
useName=s.substring(0,i);
useS=s.substring(i+1);}}}
3、定義一個(gè)Demo執(zhí)行類.要求可根據(jù)客戶不同要求計(jì)算出矩形、圓的周長和面積.
4、編寫程序,使界面中包含3個(gè)標(biāo)簽,其背景分別為紅、黃、藍(lán)3色
5、實(shí)現(xiàn)文件的復(fù)制,并輸出.
其他人氣:838 ℃時(shí)間:2020-07-11 06:41:09
優(yōu)質(zhì)解答
我來回答
類似推薦
- 麻煩各位大蝦幫我把這些習(xí)題搞定,最好每題都有過程!
- You will ask for what you A will do B have done C had done D do 選B 為什么
- 計(jì)算:x-1的絕對(duì)值
- The two pictures look the same to me.It's hard to ( )one from the other.
- Recently,great changes have taken place in my home town.這句話成立嗎?
- 已知關(guān)于X的方程A(5X-3)=6X+10無解,試求A
- 三角形ABC中D在邊AB上角ACD等于角ABC,AC等于3,AD等于1則DB等于幾
- 我國最大的鹽場是_;我國最大的漁場是_.
- 作者從養(yǎng)花中體會(huì)到的樂趣有哪些?結(jié)合課文的事例
- 把win添加一個(gè)字母變成一個(gè)新單詞,pian,than,here,read和see呢?
- 0.03化成小數(shù)
- The nazi kept those___in their concentration camp
猜你喜歡
- 1生化反應(yīng)池的工作原理是什么?
- 2(Ⅰ)解關(guān)于x的不等式:x2-2x+1-a2≥0; (Ⅱ)已知集合A是函數(shù)y=lg(20+8x-x2)的定義域,p:x∈A,q:x2-2x+1-a2≥0(a>0),若?p是q的充分不必要條件,求a的取值范圍.
- 3在第29屆奧運(yùn)會(huì)上,中國的運(yùn)動(dòng)健兒共取得幾枚金牌?
- 4若m、n互為相反數(shù),則(3m-2m)-(2m-3n)的值為__________________
- 5在除法里,114除以6等于幾|?
- 6人教版六年級(jí)語文上冊(cè)第二單元作文的讀后感急急急!
- 7下列物質(zhì)溶于水時(shí)放出熱量使溶液溫度升高的是
- 8有機(jī)化學(xué)中的官能團(tuán)有哪些?
- 9哪錯(cuò)了?select score1.學(xué)號(hào),score1.課程號(hào),course.成績 from score1,course where score1.課程號(hào)=course
- 10水遇到電時(shí)會(huì)產(chǎn)生什么反應(yīng)
- 11350*48-35*80分配律怎么算
- 12英語翻譯