Java variable Declaration

java program to show use of variables

rule = java does not allow uninitialize variable

[java]

class Variable_Demo{

public static void main(String args[])
{
int i = 35;
int j = 45;
System.out.println("The sum of " + i + " and " + j + " is " + (i+j));
}

}
[/java]

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.