java basic

Website to run Java code Online 

 

 

public class Jon {

public static void main(String[] args ){

// width of int = 32

int val1 = 5/3;

// width of float = 32 (4 bytes).

float val2 = 5f/3f;

// width of double 64 (8 bytes).

double val3 = 5d/3d;

System.out.println(“myIntValue= “+val1);

System.out.println(“myfloatValue = “+val2);

System.out.println(“myDoubleValue = “+val3);

double numPounds = 200d;

double convertKilo = numPounds*0.456783d;

System.out.println(“Kilo =” + convertKilo);

}

}