Skip to main content

Command Palette

Search for a command to run...

[Java] Float, Double Challenge

Updated
•View as Markdown

Float and Double Challenge

public class Main {

        public static void main(String[] args) {

            double numberOfPounds = 200d;
            double convertedKilograms = numberOfPounds * 0.45359237d;
            System.out.println("Converted Kilograms = " + convertedKilograms);

            double pi = 3.1415927d;
            double anotherNumber = 3_000_000.4_567_890d;
            System.out.println(pi);
            System.out.println(anotherNumber);
        }
    }

More from this blog

Jayden's Blog

166 posts