Sun . Java . Code Library . c*
{ ... // cases, from
lower to upper, from upper to lower, java.lang.String
String toLowerCase()
String toUpperCase()
... }
{ ... // cast
double x;
double y;
x = 8.888;
y = (int) x; // value 8 is assigned into y
y = (int) Math.round(x); // value 9 is assigned into y
... }
{ ... // character at
certain location, java.lang.String
char charAt (int index)
... }
{ ... // compare to other strings,
java.lang.String
int compareTo(String otherStrings)
... }
{ ... // concatenation,
WHEN joining 2 or more strings together
String pVectorD1;
String pVectorD2;
pVectorD1 = "TTC";
pVectorD2 = "ACT";
String atcg = pVectorD1 + pVectorD2;
System.out.println(atcg); // printing TTCACT ... ,
at this moment, possible
mutation is
CA*
... }
{ ... //
conditional variables,
1st to understand scopes and its nested logic, example 1
function_name (data_type parameterized_arguments)
{ // 1st scope
int x; // variable x as integer
y = computing value; // WRONG DESIGN, because variable y has not been defined
yet
z = computing value; // WRONG DESIGN, because variable z has not been defined
yet
... {
int y; // variable y
as integer, but only within THIS 2nd nested scope the function_name
int x; // WRONG DESIGN, because variable x has been
redefined
z = computing value; // WRONG DESIGN, because variable z
undefined
...{
int z; //
variable z as interger, but only within
THIS 3rd nested scope the function_name
int x, y; // WRONG DESIGN, because
variable x and y have been redefined
x = non integer computing value; // WRONG DESIGN, because x has been defined as integer
// WRONG
DESIGN, because y has been predefined, but never
use neither in 2nd nor 3rd
... }
}
}
// therefore, conditional variables are classified into defined/predefined/redefined/undefined/... /...
... }
{ ... // constant, mathematical
constant
Math.E
Math.PI
... }
{ ... // constant note: use
final only for constant
final double variable_name = number;
...
}