IT COOKBOOK 14
Java
P r e f a c e Stay HungryStay Foolish 3D 15 C 3 16 Stay HungryStay Foolish CEO 2005
L e c t u r e S c h e d u l e 1 14
PPT API C
A b o u t T h i s B o o k IT CookBook for Beginner Chapter 04 Method Overriding setcolor setcolor public private MountainBike DownhillBike prtinfo 149 01 package javabook.ch04; 02 03 public class ObjExam2 { 04 String name; 05 int num; 06 07 public ObjExam2() { 08 name = ""; 09 num = 90; 10 } 11 12 public ObjExam2(int num, String name) { 13 this.num = num; 14 this.name = name; 15 } 16 17 public void prtvars() { 18 System.out.println(" : " + num); 19 System.out.println(" : " + name); 20 } 21 22 public static void main(string[] args) { 23 ObjExam2 obj1 = new ObjExam2(); 24 ObjExam2 obj2 = new ObjExam2(220, ""); name num super 01 package javabook.ch04; 02 03 public class Extra4_1 { 04 05 public static void main(string[] args) { 06 ObjExam1 obj1 = ( ); ObjExam2(20, 07 ObjExam2 obj2 = new ""); 08 09 obj1.( ) = ""; 10 11 obj1.prtname(); 12 ( ).prtvars(); 13 } 14 15 } 25 26 obj1.prtvars(); 27 obj2.prtvars(); 28 } 29 30 } : : 20 : : 90 : : 220 : 136 137
true false true Java example false 01 package javabook.ch03; 02 03 public class LogicVarExam { 04 05 public static void main(string[] args) { Piano : volumeup() Piano : volumedown() Piano : play() 06 boolean blogic = true; 07 08 System.out.println(" blogic : " + blogic); 09 10 blogic = false; Flute : volumeup() 11 System.out.println(" blogic : " + blogic); 12 } Flute : volumedown() Flute : play() 13 14 } blogic : true blogic : false 01 package javabook.ch05; 02 03 public abstract class Instrument { 04 abstract void play(); 70 05 abstract void volumeup(); 06 abstract void volumedown(); 07 } 173 >> Java Programming >> IT CookBook for Beginner while true Thread Runnable Thread run start run Thread Runnable Thread 226 227
C o n t e n t s Chapter 01
Chapter 02
C o n t e n t s Chapter 03
Chapter 04
C o n t e n t s Chapter 05
Chapter 06
C o n t e n t s Chapter 07
Chapter 08 GUI
C o n t e n t s Chapter 09
Chapter 10
C o n t e n t s Chapter 11
Chapter 12
C o n t e n t s Chapter 13 Math Chapter 14