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 byte
        System.out.println("x as integer:" + x + ", x as byte:" + x.byteValue());
        System.out.println("y as float:" + y + ", y as byte:" + y.byteValue());

    }
}