advertisement

2013年4月16日

JAVA 2013/04/14

Variable
1. Field (Instance variavles)
    a. Declare inside the class brace.
    b. It gets default value.有預設值
2.Local variable
    a. Declare inside the method brace.
    b. It is not able to use before desing a value to it.
3.Parameter (Argument)
    a.Declare in parameter list.
    b. Its was desinged by method calls statement.



a++;++a, a=a+1

a=a+1;                   int c=a+b;
int c=a+b;              a=a+1;
int c=++a +b;         int c=a++ +b;

int d=a++ + --b + b++ - C++;
順序為
--b
a++
b++
c++

C語言宣告常數 constant
Java為find

byte b=8;
byte b2=8;
byte b3=b+b2;(X)整數運算其型態還是為int故超過byte
不林值不可轉換

任何型別與文字串聯作運算的一律轉成文字

Shirt               s;  用來控制物件shirt所以要參考的s
參考型別 參考變數

string是唯一有字面值的物件  一個雙引號為一個string型別物件

沒有留言:

張貼留言

文章有誤或有問題麻煩您留言告知! 謝謝您~~