Skip to content

Instantly share code, notes, and snippets.

@josephkandi
Created May 6, 2016 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephkandi/e7560c3fdb5b531ac35603811ec0508e to your computer and use it in GitHub Desktop.
Save josephkandi/e7560c3fdb5b531ac35603811ec0508e to your computer and use it in GitHub Desktop.
class DoubleDemo {
public static void main (String[] args) {
//A double type holds a floating point number
//A double is a 64-bit precision floating point number
//Use double type for high precesion floating point types
double averageScore = 550.50;
System.out.println("averageScore " + averageScore);
//We can also prefix it with a D or d but a floating point literal is automatically a double value
double totalScore = 975.05D;
System.out.println("totalScore " + totalScore);
//We can also use scientifc notifcation to represent the double value
double minimumDoubleValue = 4.9E-324;
double maximumDoubleValue = 1.7976931348623157E308;
System.out.println("minimumDoubleValue " + minimumDoubleValue);
//TODO
//Change the value of totalScore and use the small d instead of the D and Run again
//Notice we can either use a d or D or leave the prefix out
//Create a variable called height and assign it your double height value
//Print the height to the console
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment