In Java, the double keyword is used to declared a variable as a numeric type. A double value can hold a 64-bit floating-point number. For example:
double balanceAmount;
The double keyword can be used to declared return type of a method as well:
public double getBalance() {
return balanceAmount;
}
See all keywords in Java.
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.