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

正文內(nèi)容

java程序的設(shè)計(jì)試題與答案(編輯修改稿)

2024-07-19 18:08 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 Connection getConnection(){ ……//此處省略n行 } /* 查詢(xún)數(shù)據(jù)庫(kù)中所有學(xué)生的數(shù)據(jù),將一條學(xué)生信息記錄轉(zhuǎn)化成一個(gè)Studetn對(duì)象, * 多個(gè)記錄生成多個(gè)Student,將生成的對(duì)象放入到List中,一起返回到 */ ListStudent queryAllStudent(){ ListStudent stuList= (30) 。//創(chuàng)建可以存儲(chǔ)Student的List Connection conn=null。 Statement st=null。 ResultSet rs=null。 try { conn=getConnection()。 st= (31) .createStatement()。 //通過(guò)連接創(chuàng)建statement rs=(SELECT ID,NAME,GENDER FROM Students)。 while( (32) ){ //結(jié)果是否有記錄 Student stu=new Student( (ID), (NAME), (GENDER))。 (33) 。 //把stu對(duì)象加入到stuList中 } } catch (SQLException e) { ()。 }finally{ try { ()。 ()。 ()。 } catch (SQLException e) {} } return stuList。 } /*顯示List中的學(xué)生 */ void showStudent(ListStudent stuList){ for(______(34)_______s:stuList){ //指明s的類(lèi)型 (s)。 } } public static void main(String[] args) { T30 demo=new T30()。 ListStudent stuList=()。 (stuList)。 }}運(yùn)行結(jié)果Student [id=2, name=Name02, gender=女]Student [id=4, name=Name04, gender=女]得分閱卷人四、基本代碼編寫(xiě)(共12分)3(5分)編寫(xiě)一個(gè)main方法,計(jì)算如下數(shù)組元素的平均值 double source[]={2,5,9,10,3}。3(7分)文件名解析器,仔細(xì)閱讀如下代碼和運(yùn)行結(jié)果,完成WindowsFileNameParse類(lèi)的代碼,執(zhí)行后得到給定的運(yùn)行結(jié)果。interface FileNameParse{ void showSourceFileName()。 String getDiskName()。 String getFullFileName()。 String getFileName()。 String getExtendName()。 String getDir()。 }class WindowsFileNameParse implements FileNameParse{ private String fileName。 WindowsFileNameParse(String fileName){ =fileName。 } public void showSourceFileName(){ (解析文件名:+)。 } ////////////////////////////////////////////////////////////////////////////////////// //////////請(qǐng)完成此類(lèi)的中其他方法的代碼////////////////////////}public class T36 { public static void main(String[] args) { FileNameParse fp=new WindowsFileNameParse(d:/My Documents/MyJob/Pages/201220132/PageA/src/)。 ()。 (盤(pán)符:+())。 (文件全名(帶擴(kuò)展名):+())。 (文件名(不帶擴(kuò)展名):+())。 (文件擴(kuò)展名:+())。 (路徑(不帶盤(pán)符):+())。 }}運(yùn)行結(jié)果解析文件名:d:/My Documents/MyJob/Pages/201220132/PageA/src/盤(pán)符:d文件全名(帶擴(kuò)展名):文件名(不帶擴(kuò)展名):T37文件擴(kuò)展名:java路徑(不帶盤(pán)符):/My Documents/MyJob/Pages/201220132/PageA/src附 String類(lèi)部分的api docpublic int indexOf(String str)Returns the index within this string of the first occurrence of the specified substring. Examples: abca.indexOf(a) return 0Parameters:str the substring to search for.Returns:the index of the first occurrence of the specified substring, or 1 if there is no such occurrence.public int lastIndexOf(String str)Returns the index within th
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1