為了讓class所有物件都可取用的global物件

flyinsky76 發表在 痞客邦 留言(0) 人氣()

DTD(Document Type Definition)
-文件格式定義
-作用:定義和規範特定XML文件的內容架構
-內容:一個含有某一種特定格式正式定義的檔案文件

flyinsky76 發表在 痞客邦 留言(0) 人氣()

Meta
-key-用來描述keyword,使得搜尋引擎可以找到
-description-描述網頁主要內容

flyinsky76 發表在 痞客邦 留言(0) 人氣()

Static - 沒有隱含的this參考指標指向物件,只允許存取static成員
NonStatic - 可直接存取non-static & static 成員
Example:
public class Test
{
void aMethod()
{
bMethod(); //可直接呼叫
dMethod(); //可直接呼叫
}
void bMethod() {};
static void cMethod()
{
bMethod(); //不可直接呼叫
dMethod(); //可直接呼叫
}
static void dMethod()
{
new Test().bMethod(); //可呼叫
}
}
結論: java中在類別裡Method可以由前呼叫到後面一個是跟C++較不同的地方

flyinsky76 發表在 痞客邦 留言(0) 人氣()


 
Ex:
class test

flyinsky76 發表在 痞客邦 留言(0) 人氣()


Ex:
typedef int type; 
class Test

flyinsky76 發表在 痞客邦 留言(0) 人氣()


throw:
一旦程式碼偵測到錯誤,便用它表示遇上了無法處理的錯誤

flyinsky76 發表在 痞客邦 留言(0) 人氣()


dynamic_cast<type>(val);   //動態強制轉型
const_cast<type>(val);      //常數強制轉型

flyinsky76 發表在 痞客邦 留言(0) 人氣()


Ex: int maxval = i>j ? i : j;  //if i > j maxval = i , else maxval = j

flyinsky76 發表在 痞客邦 留言(0) 人氣()


sizeof (type name);
sizeof (expr);
sizeof expr;

flyinsky76 發表在 痞客邦 留言(0) 人氣()


第一種方式:
#include<ctime>

flyinsky76 發表在 痞客邦 留言(0) 人氣()

  • Apr 02 Thu 2009 14:04
  • Array


const int *ptr = new const int[100]();  //const必須經過value-initialized
 

flyinsky76 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。