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

正文內(nèi)容

軟件技術(shù)基礎(chǔ)java考試題及答案-資料下載頁(yè)

2025-08-11 06:25本頁(yè)面
  

【正文】 造函數(shù),形參 y、m、d分別為某個(gè)日期的年月日的初值。 int GetYear( ) :獲取日期的年份作為方法的返回值。int GetMonth( ) :獲取日期的月份作為方法的返回值。int GetDay( ) :獲取日期的日作為方法的返回值。void ShowDate( ) :以 ****年**月**日 的形式顯示一個(gè)日期。參考程序如下:import .* 。 // 1分public class abc // 2分{ public static void main(String args[ ]) // 3分 { int i , n = 10 , s = 0 。 for ( i = 1 。 i = n 。 i ++ ) // 5分 try { // 6分 BufferedReader br = new BufferedReader( new InputStreamReader())。 s += (( ))。 // 9分 } catch ( IOException e ) { } 。 (s=+s)。 // 10分 }} 參考程序如下:import .* 。 // (引入包正確得1分)import .* 。public class abc extends Applet // (主類(lèi)格式正確2分){ Complex a,b,c 。 public void init( ) // (創(chuàng)建三個(gè)復(fù)數(shù)對(duì)象3分) { a = new Complex(1,2)。 //創(chuàng)建復(fù)數(shù)對(duì)象 1+2i b = new Complex(3,4)。 //創(chuàng)建復(fù)數(shù)對(duì)象 3+4i c = new Complex()。 //創(chuàng)建復(fù)數(shù)對(duì)象(存放a+b) } public void paint(Graphics g) // (輸出復(fù)數(shù)對(duì)象4分) { c=(b)。 (第一個(gè)復(fù)數(shù):+(),10,50)。 (第二個(gè)復(fù)數(shù):+(),10,70)。 (兩復(fù)數(shù)之和:+(),10,90)。 }} class Complex{ int RealPart 。 //復(fù)數(shù)的實(shí)部 // (定義復(fù)數(shù)屬性5分) int ImaginPart 。 //復(fù)數(shù)的虛部 Complex() { RealPart = 0 。 ImaginPart = 0 。 } // (參構(gòu)造函數(shù) 6分) Complex(int r , int i) // (有參構(gòu)造函數(shù) 7分) { RealPart = r 。 ImaginPart = i 。 } Complex plexAdd(Complex a) // (當(dāng)前復(fù)數(shù)對(duì)象與形參復(fù)數(shù)對(duì)象相加 9分) { Complex temp = new Complex( )。 //臨時(shí)復(fù)數(shù)對(duì)象 =RealPart+。 =ImaginPart+。 return temp。 } public String toString( ) // (輸出方法10分) { return ( RealPart+ + +ImaginPart+ i )。 }}參考程序如下:import .*。public class SUM{ public static void main (String[] args) { int i , n=1 , sum=0 。 while ( n1) try { BufferedReader br = new BufferedReader( new InputStreamReader())。 n = (( ))。 } catch ( IOException e ) { } 。 for ( i =1 。 i=n。 i++ ) sum += i。 (sum)。 } } 參考程序如下:public class Date{ int year , month , day 。 Date( ) { year = 2000 。 month = 1 。 day = 1 。 } Date( int y , int m , int d) { year = y 。 month = m 。 day = d 。 } int GetYear( ) { return year。 } int GetMonth( ) { return month。 } int GetDay( ) { return day。 } void ShowDate( ) { (year+年+month+月+day+日)。 }}
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1