BASIC / NOTES</>↗Basic20 Oct 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 / NOTES</>↗Core API20 Oct 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 / NOTES</>↗Core API20 Oct 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 / NOTES</>↗Core API20 Oct 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 = […]
BASIC / NOTES</>↗Basic19 Oct 2010
Every instance method has a variable with the name this that refers to the current object for which the method is being called. You can refer to any member of the current object from within an instance method or a constructor by using this keyword. Each time an instance method is called, the this variable […]
BASIC / NOTES</>↗Basic19 Oct 2010
The return keyword is used to return from a method when its execution is complete. When a return statement is reached in a method, the program returns to the code that invoked it. A method can return a value or reference type or does not return a value. If a method does not return a […]