codescracker


java

Java Program to Print Integers



« Previous Program Next Program »


Print Integers

To print integers in Java Programming, you have to just initialize the integer value to any variable say num and place the variable in the bracket of System.out.println()

Java Programming Code to Print Integers

Following Java Program prints the value of the variable num which holds an integer value:

/* Java Program Example - Print Integer */
		
public class JavaProgram
{
    public static void main(String args[])
    {
	
        int num = 10;
        System.out.println("The value of num is " + num);
		
    }
}

When the above Java Program is compile and executed, it will produce the following output:

Java Program print integer

Same Program in Other Languages

You may also like to learn and practice the same program in other popular programming languages:


« Previous Program Next Program »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test