BASIC / CATATAN</>↗Basic25 Okt 2010
Equality operator is used to compare two similar things (numbers, characters, boolean, primitives and object references). Equality operator will always result in boolean value (true or false). For object reference, it will return true if only both reference variables refer to the same object. package org.kodejava.basic; public class EqualityDemo { public static void main(String[] args) […]
BASIC / CATATAN</>↗Basic25 Okt 2010
The && operator also known as conditional-AND operator or short circuit AND. This operator exhibit “short-circuiting” behavior, which means that the second operand is evaluated only if needed. The && operator evaluate only boolean values. For an AND (&&) expression to be true, both operands must be true. If the first operand resolves false, then […]
BASIC / CATATAN</>↗Basic20 Okt 2010
To define a constant in Java, use final modifier which combined with static modifier. The final modifier indicates that the value of this field cannot change. If you change the value of the constant, you need to recompile the class to get the current value. Other feature in Java that provide similar functionality is enumeration […]
CORE API / CATATAN</>↗Core API20 Okt 2010
Hypot is a mathematical function defined to calculate the length of the hypotenuse of a right-angle triangle. It was designed to avoid errors arising due to limited-precision calculations performed on computers. From: Wikipedia The Math.hypot(double x, double y) return the sqrt(x2+ y2) without intermediate overflow or underflow. The result will be same with this calculation […]
CORE API / CATATAN</>↗Core API20 Okt 2010
In mathematics, the exponential function is the function ex, where e is the number (approximately 2.718281828) such that the function ex equals its own derivative. The function f(x) = ex at the point x = 0 is equal to 1. package org.kodejava.math; public class ExponentExample { public static void main(String[] args) { double x = […]
CORE API / CATATAN</>↗Core API20 Okt 2010
The exponential function is f(x) = ex. The Math.getExponent() method is used to get the x value of the given parameter, in which the parameter is a result of exponential function calculation. package org.kodejava.math; public class GetExponent { public static void main(String[] args) { double fx = 1.0d; float fx1 = 1.0f; int x = […]