Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
How to declare a constant in Java?
Tuesday, February 15, 2011 Tuesday, February 15, 2011
Posted by Programming Documentation Blog
The statement of declaring a constant in Java is final
Code:
final static double PI = 3.14; final int DAY = 24;
PLEASE note that the constant name should be in CAPITAL LETTERS.
Starting Java
Tuesday, February 15, 2011
Posted by Programming Documentation Blog
This is my first post about Java programming language, I'll start this post with variables and how to declare them.
int i; int i,j,k; int m = 1, s = 2, k = 40; float r; double w = 2.5; String myString = "Hello"; String mySt = 'This is wrong'; // Wrong declaration of String ... it should be with double qoute
Subscribe to:
Posts (Atom)