A Day 2 Exercise In Learning Java
Today we are going to use java to do a math problem.
type in
public class Add
{
public static void main (strings[]args)
{
int num;
num = 5;
system.out.print("the value of num is" );
system.out.println(num);
}
}
This creates a variable and tells the java program its there
Doing this you tell the java program what it's value is
if you noticed i put a ln after print in the system.out statement this tells it to put it with the one above and include it one one line so it looks like *The Value of num is 5*
Last edited by jamesm201 : 03-02-2011 at 11:22 PM.
|