// Application to sum numbers public class Sum { public static void main (String[] args) { // variable declarations of primitive types, initialization int a=2, b=3, firstsum; double x = 4.5, y, secondsum; float f = 1.2F; // arithmetic and assignment firstsum = a + b; // cast - type conversion - not required here y = (double) firstsum; /* more arithmetic and print to standard out using string catenation to prepare output string */ secondsum = x + y; System.out.println("\n" + "The first sum is " + firstsum); System.out.println("The second sum is " + secondsum + "\n"); } }