Thursday, March 17, 2011

Alyssa Milano Interview Shannen

Java constants

The Java constants used to use values \u200b\u200b data types that will be constant during program execution, unlike variables that can be modified at any time.

Once assigned to a constant value, it can not be changed later.

is not necessary to start the value of a constant declaration time, but once you assign a value to that constant, this value can not be modified.

The name that identifies a constant identifier is called .
To declare a constant using the keyword final , then define the data type and then writes the identifier of the constant.


DECLARE CONSTANT NOT STARTED

final type identifier;

 
final int age;




declare several constants
NOT STARTED


final identificador1 type, identificador2 .. , IdentificadorN;

 
final float a, b, c;




AND BEGIN DECLARE AT A TIME CONSTANT

final type identifier = value;

 final 
double size = 1.72;




MULTIPLE CONSTANT AND BEGIN DECLARE BOTH

final identificador1 type = value1, value2 = identificador2 ... , IdentificadorN = valueN;

 
final boolean a = true, b = false, c = false;

0 comments:

Post a Comment