關於8月9日及8月10日這兩天是我第一個星期去補SCJP課程的日子!這門課將連續要上四個星期!每個星期皆是從上午九點到下午五點為上課時間!
話說表訂時數是56小時,但扣除中午休息時間一小時再去乘上天數則剛剛好為56小時,所以下課時間就含進上課時數嘍!
但我想老師教的完我也不會太在乎吧!不休息一下也不好XD而且下課也沒休息太久就是了...再說,我覺得這個老師教的不錯,比學校的好太多、太多嘍!
雖然目前教的東西還不算太難,但至少也幫助我注意到一些以前沒發現到的問題及觀念!所以感覺還不錯啦!![](https://s.pixfs.net/f.pixnet.net/images/emotions/b02.gif)
不過我也沒想到才第二天上課,就可以開始與同學討論程式的問題嘍!
以下是在與同學討論及教同學時發現一些比較重要的觀念寫在這紀錄一下嘍!![](https://s.pixfs.net/f.pixnet.net/images/emotions/b05.gif)
public class TestScoping{
public static void main (String[] args){
System.out.println("Scoping a = "+Scoping.a);
Scoping s = new Scoping();
/*因這邊已把Scoping設定成一個物件了
所以下面執行的每行程式都要去follow物件s
假如將這行往上移一行的話,Scoping.a也要改成s.a*/
System.out.println("Scoping b = " + s.b);
System.out.println("Scoping c = " + s.c);
/*System.out.println("Scoping s= " + s.s);
System.out.println("Scoping bb = " + ts.bb);
System.out.println("Scoping d = " + s.d);*/
s.mA(3,4);
}
}
public class TestProduct{
public static void main (String[] args){
Product p = new Product();
System.out.println(p);
System.out.println("----------給值後---------" + "\n");
p.setId(1); //要記得在設定的時候是不用寫"="的唷!
p.setName("PS3");
p.setUnitPrice(12000.0);
p.incStock(1000);
System.out.println(p);
ProductService ps = new ProductService();
System.out.println(p.getName() + "的產品庫價價值= " +
ps.calculateProductInventory(p)); //也別忘記要給他物件(p)唷!
}
}
public class TestProduct{
public static void main (String[] args){
Product p = new Product(1,"will", 7500.0, false, 1000);
/*在Product 用了建構子
public Product(int id, String name){
his(id, name, 0.0, false, 0);
}
所以這別也別忘了要在新增物件的時候給他初始值*/
ProductService ps = new ProductService();
System.out.println(p.getName() + "的產品庫價價值= " +
ps.calculateProductInventory(p));
Product p2 = new Product(2,"PSP");
System.out.println(p2);
p2.setUnitPrice(6800.0);
p2.setFree(false);
p2.incStock(2000);
System.out.println(p2);
}
}
話說表訂時數是56小時,但扣除中午休息時間一小時再去乘上天數則剛剛好為56小時,所以下課時間就含進上課時數嘍!
但我想老師教的完我也不會太在乎吧!不休息一下也不好XD而且下課也沒休息太久就是了...再說,我覺得這個老師教的不錯,比學校的好太多、太多嘍!
雖然目前教的東西還不算太難,但至少也幫助我注意到一些以前沒發現到的問題及觀念!所以感覺還不錯啦!
![](https://s.pixfs.net/f.pixnet.net/images/emotions/b02.gif)
不過我也沒想到才第二天上課,就可以開始與同學討論程式的問題嘍!
以下是在與同學討論及教同學時發現一些比較重要的觀念寫在這紀錄一下嘍!
![](https://s.pixfs.net/f.pixnet.net/images/emotions/b05.gif)
public class TestScoping{
public static void main (String[] args){
System.out.println("Scoping a = "+Scoping.a);
Scoping s = new Scoping();
/*因這邊已把Scoping設定成一個物件了
所以下面執行的每行程式都要去follow物件s
假如將這行往上移一行的話,Scoping.a也要改成s.a*/
System.out.println("Scoping b = " + s.b);
System.out.println("Scoping c = " + s.c);
/*System.out.println("Scoping s= " + s.s);
System.out.println("Scoping bb = " + ts.bb);
System.out.println("Scoping d = " + s.d);*/
s.mA(3,4);
}
}
public class TestProduct{
public static void main (String[] args){
Product p = new Product();
System.out.println(p);
System.out.println("----------給值後---------" + "\n");
p.setId(1); //要記得在設定的時候是不用寫"="的唷!
p.setName("PS3");
p.setUnitPrice(12000.0);
p.incStock(1000);
System.out.println(p);
ProductService ps = new ProductService();
System.out.println(p.getName() + "的產品庫價價值= " +
ps.calculateProductInventory(p)); //也別忘記要給他物件(p)唷!
}
}
public class TestProduct{
public static void main (String[] args){
Product p = new Product(1,"will", 7500.0, false, 1000);
/*在Product 用了建構子
public Product(int id, String name){
his(id, name, 0.0, false, 0);
}
所以這別也別忘了要在新增物件的時候給他初始值*/
ProductService ps = new ProductService();
System.out.println(p.getName() + "的產品庫價價值= " +
ps.calculateProductInventory(p));
Product p2 = new Product(2,"PSP");
System.out.println(p2);
p2.setUnitPrice(6800.0);
p2.setFree(false);
p2.incStock(2000);
System.out.println(p2);
}
}
全站熱搜