How to code break and continue
The break and continue statements alter the looping of code. Without a labelName: the break will exit a loop […]
Read More →The break and continue statements alter the looping of code. Without a labelName: the break will exit a loop […]
Read More →switch(productID) { case 1: productName="abc"; break; case 2: case 3: productName = "xyz"; break; default: produceName = "unknown"; break; […]
Read More →java.math.BigDecimal BigDecimal(int) BigDecimal(double) BigDecimal(long) BigDecimal(String) Mehtods of the BigDecimal Add(value) compareTo(value) divide(value,scale,rounding-mode) multipy(value) setScale(scale,rounding-mode) toString() java.math.RoundingMode Two types in […]
Read More →How to use static methods to convert primitive types to String objects Interger quantityIntObject = new Integer(quantity); Double priceDoubleObject […]
Read More →import java.lang.math; round(float or double) pow(number, power) sqrt(number) max(a,b) min(a,b) random()
Read More →import java.text.NumberFormat; There are three static methods in the NumberFormat class: getCurrencyInstance() to format as $99,999.99 getPercentInstance() to format […]
Read More →Type Bytes Use byte 1 -128 to 127 short 2 -32,768 to 32,767 int 4 2,147,483,648 to 2,147,483,647 long […]
Read More →Relational operations: == Equality != Inequality > Greater than < Less than >= Greater than or equal <= Less […]
Read More →How to use output: System.out.println("Welcome"); System.out.println("Welcome: " + userName); System.out.println("Total: " + invoiceTotal); System.out.println("\n"); How to use input: Introduced […]
Read More →The syntax of the import statement import packagename.ClassName; or import packageName.*; Examples: import java.text.NumberFormat; import java.util.Scanner; import javax.swing.*; Package […]
Read More →