SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API04 Feb 2008

How do I convert BigInteger into another radix number?

In this example you’ll see how we can convert a java.math.BigInteger number into another radix such as binary, octal and hexadecimal. package org.kodejava.math; import java.math.BigInteger; public class BigIntegerConversion { public static void main(String[] args) { BigInteger number = new BigInteger("2021"); System.out.println("Number = " + number); System.out.println("Binary = " + number.toString(2)); System.out.println("Octal = " + number.toString(8)); […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API31 Jan 2008

How do I do math operation for BigDecimal?

package org.kodejava.math; import java.math.BigDecimal; import java.math.RoundingMode; public class BigDecimalOperation { public static void main(String[] args) { BigDecimal decimalA = new BigDecimal("98765432123456789"); BigDecimal decimalB = new BigDecimal("10"); decimalA = decimalA.add(decimalB); System.out.println("decimalA = " + decimalA); decimalA = decimalA.multiply(decimalB); System.out.println("decimalA = " + decimalA); decimalA = decimalA.subtract(decimalB); System....

Wayan · 1 min read
CORE API / NOTES</>↗
Core API29 Jan 2008

How do I do math operation for BigInteger?

package org.kodejava.math; import java.math.BigInteger; public class BigIntegerOperation { public static void main(String[] args) { BigInteger numberA = new BigInteger("98765432123456789"); BigInteger numberB = BigInteger.TEN; numberA = numberA.add(numberB); System.out.println("numberA = " + numberA); numberA = numberA.multiply(numberB); System.out.println("numberA = " + numberA); numberA = numberA.subtract(numberB); System.out.println("numberA = " + numberA); numberA = numbe...

Wayan · 1 min read
CORE API / NOTES</>↗
Core API27 Jan 2008

How do I get the name of a class?

package org.kodejava.lang; import java.util.Calendar; import java.math.BigDecimal; public class ClassName { public static void main(String[] args) { // Get the name of the classes below. Class<?> clazz = String.class; System.out.println("Class Name: " + clazz.getName()); clazz = Calendar.class; System.out.println("Class Name: " + clazz.getName()); clazz = BigDecimal.class; System.out.println("Class Name: " + clazz.getName()); } } The result of the […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API23 Jan 2008

How do I know if a class object is an interface or a class?

package org.kodejava.lang; public class CheckForInterface { public static void main(String[] args) { // Checking whether Cloneable is an interface or class Class<?> clazz = Cloneable.class; boolean isInterface = clazz.isInterface(); System.out.println(clazz.getName() + " is an interface = " + isInterface); // Checking whether String is an interface or class clazz = String.class; isInterface = clazz.isInterface(); System.out.println(clazz.getName() […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API20 Jan 2008

How do I get interfaces implemented by a class?

The getClass().getInterfaces() method return an array of Class that represents the interfaces implemented by an object. package org.kodejava.lang; import java.util.Date; import java.util.Calendar; public class ClassInterfaces { public static void main(String[] args) { // Get an instance of Date class Date date = Calendar.getInstance().getTime(); // Get all interfaces implemented by the java.util.Date class and // print […]

Wayan · 1 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.