March 2002
Intermediate to advanced
480 pages
18h 40m
English
Math
The CLDC Math class is an extremely small subset of its
J2SE counterpart, providing utility methods that work with
int and long values. Most of the J2SE
methods cannot be included because a CLDC VM
does not provide for floating point arithmetic.
The abs() methods return the absolute value of an
int or long pased as its argument.
The max() method returns the larger of two
ints or longs, while
min() returns the smaller.
public final class Math { // No Constructor // Public Class Methods public static int abs( int a); // strictfp public static long abs( long a); // strictfp public static int max( int a, int b); // strictfp public static long max( long a, long b); // strictfp public static int min( int a, int b); // strictfp public static long min( long a, long b); // strictfp }
Read now
Unlock full access