日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

Teach Yourself Java 2 in 21 Days 书中样例代码实践

發(fā)布時(shí)間:2023/12/10 java 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Teach Yourself Java 2 in 21 Days 书中样例代码实践 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

找了好幾書JAVA的書,看了幾章,都看不下去。

我覺得適合《Teach Yourself Java 2 in 21 Days》(Rogers Cadenhead Laura Lemay)還是適合我的。

孫衛(wèi)琴那本,我感覺就羅嗦多了沒到我點(diǎn)子上。

接口,抽象類這些內(nèi)容講得通俗易懂,看著不費(fèi)力。

代碼:

1 class VolcanoRobot { 2 String status; 3 int speed; 4 float temperature; 5 6 void checkTemperature() { 7 if (temperature > 660) { 8 status = "returning home."; 9 speed = 5; 10 } 11 } 12 13 void showAttributes() { 14 System.out.println("Status: " + status); 15 System.out.println("Speed: " + speed); 16 System.out.println("Temperature: " + temperature); 17 } 18 }

?

1 class VolcanoApplication { 2 public static void main(String[] arguments) { 3 VolcanoRobot dante = new VolcanoRobot(); 4 dante.status = "exploring"; 5 dante.speed = 2; 6 dante.temperature = 510; 7 8 dante.showAttributes(); 9 System.out.println("Increasing speed to 3."); 10 dante.speed = 3; 11 dante.showAttributes(); 12 System.out.println("Changing temperature to 670."); 13 dante.temperature = 670; 14 dante.showAttributes(); 15 System.out.println("Checking the temperature."); 16 dante.checkTemperature(); 17 dante.showAttributes(); 18 } 19 }

?

運(yùn)行:

?

轉(zhuǎn)載于:https://www.cnblogs.com/aguncn/archive/2013/03/28/2986637.html

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的Teach Yourself Java 2 in 21 Days 书中样例代码实践的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。