發表文章

「CSS」「div區塊介紹」 三欄式網頁排版設計

圖片
三欄式網頁排版設計: <! DOCTYPE HTML PUBLIC > < html > < head > < title > Free Css Layout 1 </ title > < meta http-equiv = "content-type" content = "text/html; charset=UTF-8" > </ head > < body > < style type = "text/css" > #sitebody { width : 600px ; margin : 0 auto ; font-size : 13px ; } #header { background-color : rgb ( 218 , 230 , 59 ); height : 80px ; text-align : center ; line-height : 80px ; } #sidebar_left { background-color : rgb ( 233 , 92 , 92 ); width : 120px ; height : 400px ; ...

「電腦硬體裝修」「DIP雙列直插封裝」

圖片
Dual In-line Package ,也稱為 DIP封裝 ,簡稱為 DIP 或 DIL ,是一種 積體電路的封裝方式 ,積體電路的 外形為長方形 ,在其兩側則有 兩排平行的金屬接腳 ,稱為 排針 。DIP包裝的元件可以 焊接在印刷電路板 電鍍的貫穿孔中,或是 插入在DIP插座 (socket)上。 十四針的積體電路即稱為 DIP14 :  Vcc(電源) 第14腳  GND(接地) 第7腳 十六針的積體電路即稱為 DIP16 : Vcc(電源): Vcc(電源) 第16腳  GND(接地) 第8腳 方向和接腳編號 接腳以逆時針的順序編號 如右圖所示,當元件的識別缺口朝上時,左側最上方的接腳為接腳1,其他接腳則以逆時針的順序依序編號。有時接腳1也會以圓點作為標示。 例如DIP14的IC,識別缺口朝上時,左側的接腳由上往下依序為接腳1至7,而右側的接腳由下往上依序為接腳8至14。 資料擷取於Wiki: https://zh.wikipedia.org/wiki/%E9%9B%99%E5%88%97%E7%9B%B4%E6%8F%92%E5%B0%81%E8%A3%9D

「Java」「abstract類別可以不實作介面方法」 Chapter5 Question5

Given: interface Car{ void brand(String s); } abstract class Test4 implements Car{ // insert code } Answer: 可以選擇不輸入 public void brand(String s){ } void brand() { } 但不能與實作介面的方法相同,以下會造成錯誤: void brand(String s){ }

「Java」「interface欄位與方法」 Chapter5 Question4

問題: which two forms of abstraction can a programmer use in java? 哪兩種抽象形式能在 Java程式中使用?? 選擇: enums 列舉 primitives 基本資料型別 abstract classes 抽象類別 concrete classes 實體類別 primitive wrappers 外包類別 interfaces 介面 Answer: 3 , 6 提要: Abstract classes :父類別在設計的時候,其主要目的若是要讓其他類別繼承,則我們通常稱這樣的祖先類別為abstract classes。關於這一點雖然課本上這樣解釋,但是實務上我們會說一個無法產生instance的class就稱之為abstract class。  Concrete class :和abstract classes相反,一個類別其設計之主要目的就是要讓人產生instance,則稱此類別為concrete class。實務上只要是能產生instance的類別都稱之為concrete classes。       Interfaces:     Clients remain unaware of the specific types of objects they use, as long as the objects adhere to the interface that clients expect.     Clients remain unaware of the classes that implement these objects. Clients only know about the abstract class(es) defining the interface.   This so greatly reduces implementation dependencies between subsystems that it leads to the following principle of reusable o...

「Java」「interface欄位與父類別欄位同名」 Chapter5 Question3

Given: interface Car{ String a = "Car"; public void detail(); } class SuperCar{ static String a = "SuperCar"; } public class Test4 extends SuperCar implements Car{ @Override public void detail() { System.out.println("轎車"); } public static void main(String[] args) { new Test4().detail(); System.out.println("a:"+a);//a欄位值模擬兩可 field a is ambiguous. System.out.println("a:"+SuperCar.a); System.out.println("a:"+Car.a); } } Answer: System.out.println("a:"+a); 造成編譯錯誤 原因: 介面與父類別有相同的變數名稱,會造成不知該抓取哪個值。 所以需要告知要抓取哪個變數。

「Java」「interface欄位與方法」 Chapter5 Question2

Given: interface Interface{ public abstract String AA; //錯誤,無給初始值 public abstract String getAA(); public static String BB; //錯誤,無給初始值 public String getBB(); private String CC="CCC"; //錯誤,修飾子只能是 public,static和final public static String getCC(); //錯誤,方法只能有public 或 abstract public String DD="DDD"; public abstract String getDD(); } Answer: public String DD="DDD"; public abstract String getDD(); 總整理: interface 欄位: 只能是 public, static 和 final interface 方法: 只能是 public 與 abstract

「Java」「abstract 與 interface」 Chapter5 Question1

Given these facts about java types in an application: Tips: -Type x is a template for other types in the application. ( X是模板並提供給其他使用。) -Type x implements doStuff(). (X可實作 doStuff()方法。 判斷: X不會是介面interface) -Type x declares, but does NOT implement  doIt(). (宣告X,但無法 實作 doIt() 方法。 判斷: X可能是 abstract 或 interface) -Type y declares doOther(). (Y 宣告 doOther() 方法。 判斷: X可能是抽象類別或介面) Which three are true? 1. Type y must be an interface. (Y必定是Interface介面) 2. Type x must be an abstract class. (X必定是抽象類別) 3. Type y could be an abstract class or an interface. (Y可以是抽象類別或介面) 4. Type x could be an abstract class or an interface. (X可以是抽象類別或介面) 5. Type x could implement or extend from Type y. (X可在 實作 或 繼承 Y) 6. Type y must be an abstract class. (Y必定是抽象類別) Answer: 2 , 3 , 5 Hint: 1. X 只有可能是 abstract 2. Y 有可能是 abstract 與 interface 3. abstract 可以在 繼承 abstract 與 實作 interface