abalfazl hossein wrote:What are difference between final variable in JAVA and constant in C? or variable use define keyword in C?
By "constant in C", I am assuming through the use of the "const" keyword?
In Java, variables that are defined as final, can't be modified. In this regard, it is very similar to variables in C, that are declared as const. Furthermore, the java compiler has the concept of compile time constants, and can treat variables as "constant variables" (variables that are compile time constants). In this regard, it is probably more similar to preprocesor constants in C (using the #define macro).
So... depending on how the final variable is declared in Java, it can be closer to "const" variables or "#define" constants, when comparing to C.