freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java2實(shí)用教程第5版習(xí)題解答(編輯修改稿)

2025-04-20 04:56 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 } } else if(()==buttonSub) { double n1,n2。 try{ n1=(())。 n2=(())。 n=n1n2。 ((n))。 ()。 } catch(NumberFormatException ee) { (請(qǐng)輸入數(shù)字字符)。 } } else if(()==buttonMul) {double n1,n2。 try{ n1=(())。 n2=(())。 n=n1*n2。 ((n))。 (*)。 } catch(NumberFormatException ee) { (請(qǐng)輸入數(shù)字字符)。 } } else if(()==buttonDiv) {double n1,n2。 try{ n1=(())。 n2=(())。 n=n1/n2。 ((n))。 (/)。 } catch(NumberFormatException ee) { (請(qǐng)輸入數(shù)字字符)。 } } validate()。 }}3. import .*。import .*。import .*。public class E { public static void main(String args[]){ Window win = new Window()。 (使用MVC結(jié)構(gòu))。 (100,100,420,260)。 }}class Window extends JFrame implements ActionListener { Lader lader。 //模型 JTextField textAbove,textBottom,textHeight。 //視圖 JTextArea showArea。 //視圖 JButton controlButton。 //控制器 Window() { init()。 setVisible(true)。 setDefaultCloseOperation()。 } void init() { lader = new Lader()。 textAbove = new JTextField(5)。 textBottom = new JTextField(5)。 textHeight = new JTextField(5)。 showArea = new JTextArea()。 controlButton=new JButton(計(jì)算面積)。 JPanel pNorth=new JPanel()。 (new JLabel(上底:))。 (textAbove)。 (new JLabel(下底:))。 (textBottom)。 (new JLabel(高:))。 (textHeight)。 (controlButton)。 (this)。 add(pNorth,)。 add(new JScrollPane(showArea),)。 } public void actionPerformed(ActionEvent e) { try{ double above = (().trim())。 double bottom = (().trim())。 double height = (().trim())。 (above) 。 (bottom)。 (height)。 double area = ()。 (面積:+area+\n)。 } catch(Exception ex) { (\n+ex+\n)。 } }}class Lader { double above,bottom,height。 public double getArea() { double area = (above+bottom)*height/。 return area。 } public void setAbove(double a) { above = a。 } public void setBottom(double b) { bottom = b。 } public void setHeight(double c) { height = c。 }}習(xí)題10(第10章)一、問(wèn)答題1.使用FileInputStream。2.FileInputStream按字節(jié)讀取文件,F(xiàn)ileReader按字符讀取文件。3.不可以。4.使用對(duì)象流寫(xiě)入或讀入對(duì)象時(shí),要保證對(duì)象是序列化的。5.使用對(duì)象流很容易得獲取一個(gè)序列化對(duì)象的克隆,只需將該對(duì)象寫(xiě)入到對(duì)象輸出流,那么用對(duì)象輸入流讀回的對(duì)象一定是原對(duì)象的一個(gè)克隆。二、選擇題1.C。2.B。三、閱讀程序1.【代碼1】:51。【代碼2】:0。2.【代碼1】:3?!敬a2】:abc?!敬a3】:1?!敬a4】:dbc。3.上機(jī)實(shí)習(xí)題,解答略。四、編程題1. import .*。public class E { public static void main(String args[]) { File f=new File()。 try{ RandomAccessFile random=new RandomAccessFile(f,rw)。 (0)。 long m=()。 while(m=0) { m=m1。 (m)。 int c=()。 if(c=255amp。amp。c=0) ((char)c)。 else { m=m1。 (m)。 byte cc[]=new byte[2]。 (cc)。 (new String(cc))。 } } } catch(Exception exp){} }}2. import .*。public class E { public static void main(String args[ ]) { File file=new File()。 File tempFile=new File()。 try{ FileReader inOne=new FileReader(file)。 BufferedReader inTwo= new BufferedReader(inOne)。 FileWriter tofile=new FileWriter(tempFile)。 BufferedWriter out= new BufferedWriter(tofile)。 String s=null。 int i=0。 s=()。 while(s!=null) { i++。 (i+ +s)。 ()。 s=()。 } ()。 ()。 ()。 ()。 ()。 } catch(IOException e){} }}3. import .*。import .*。public class E { public static void main(String args[]) { File file = new File()。 Scanner sc = null。 double sum=0。 int count = 0。 try { sc = new Scanner(file)。 ([^0123456789.]+)。 while(()){ try{ double price = ()。 count++。 sum = sum+price。 (price)。 } catch(InputMismatchException exp){ String t = ()。 } } (平均價(jià)格:+sum/count)。 } catch(Exception exp){ (exp)。 } }}習(xí)題11(第11章)一、問(wèn)答題1.在MySQL安裝目錄的bin子目錄下鍵入mysqld或mysqld nt 啟動(dòng)MySQL數(shù)據(jù)庫(kù)服務(wù)器。2.復(fù)制到JDK的擴(kuò)展目錄中(即JAVA_HOME環(huán)境變量指定的JDK,),比如:E:\\jre\lib\ext。3.減輕數(shù)據(jù)庫(kù)內(nèi)部SQL語(yǔ)句解釋器的負(fù)擔(dān)。4.事務(wù)由一組SQL語(yǔ)句組成,所謂事務(wù)處理是指:應(yīng)用程序保證事務(wù)中的SQL語(yǔ)句要么全部都執(zhí)行,要么一個(gè)都不執(zhí)行。事務(wù)處理步驟是調(diào)用:(1)連接對(duì)象用setAutoCommit()方法關(guān)閉自動(dòng)提交模式,(2)連接對(duì)象用mit()方法處理事務(wù),(3)連接對(duì)象用rollback()方法處理事務(wù)失敗。二、編程題1. 同時(shí)用到了例子2中的GetDBConnection類(lèi)。import .*。import .*。 public class BianCheng1 { public static void main(String args[]) { Connection con。 Statement sql。 ResultSet rs。 con = (students,root,)。 if(con == null ) return。 String sqlStr = select * from mess order by birthday。 try { sql=()。 rs = (sqlStr)。 while(()) { String number=(1)。 String name=(2)。 Date date=(3)。 float height=(4)。 (%s\t,number)。 (%s\t,name)。 (%s\t,date)。 (%.2f\n,height)。 } ()。 } catch(SQLException e) {
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1