Monday 5 October 2015

Java Tutorial : Java Floating Point Literals


Click here to watch in Youtube :
https://www.youtube.com/watch?v=eD0-FyZ7Dv8&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java Floating Point Literals
FloatingPointLiteralDemo.java
public class FloatingPointLiteralDemo
{

    public static void main(String[] args)
    {

        double d1 = 123.4;

        System.out.println("d1 : " + d1);

        double d2 = 1.234e2; // same value as d1, but in scientific notation

        System.out.println("d2 : " + d2);

        float f1 = 123.4f;

        System.out.println("f1 : " + f1);

        double d3 = 3.4d;

        System.out.println("d3 : " + d3);
        
        double num = 1_567_2_82.0;
        
        System.out.println("num : " + num);

    }
}
Output
d1 : 123.4
d2 : 123.4
f1 : 123.4
d3 : 3.4
num : 1567282.0
To Download VariableDemoFloatingPointLiteralApp  Project Click the below link
https://sites.google.com/site/javaee4321/java/VariableDemoFloatingPointLiteralApp.zip?attredirects=0&d=1

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment