Type Casting

[PHP],[Java]

$value = (datatype) $srcValue;
$value = (int) $srcValue;
$value = (boolean) $srcValue;
$value = (array) $srcValue;
$value = (unset) $srcValue;  // cast to NULL
( int, integer , bool, boolean, float, double, real, array, object, unset)

In JAVA explicit type cast must carried out by user
whereas reverse of this implicit cast is not necessary







[Javascript]

String To number :
num = Number("324");   // return 324
parseInt();
parseFloat();


Number To string :
string(number);
number.toString();



Share this

Related Posts

Previous
Next Post »