Friday, October 31, 2014

Variables in Java

This is how variables are to be printed in the Java program.
The number is 5.
It can also be written as this 5
view raw output.java hosted with ❤ by GitHub
public class Variables {
public static void main(String[] args) {
int i=5;
System.out.print("The number is ");
System.out.print(i);
System.out.println(".");
System.out.print("It can also be written as this "+i);
}
}
view raw Variables.java hosted with ❤ by GitHub

No comments:

Post a Comment