Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {

        // get a number as integer
        Number x = new Integer(123456);

        // get a number as float
        Number y = new Float(9876f);

        // print their value as double
        System.out.println("x as integer :" + x + ", x as double:" + x.doubleValue());
        System.out.println("y as float::" + y + ", y as double:" + x.doubleValue());

    }
}