jamesm201
Forum Addict
- Joined
- Feb 7, 2011
- Sythe Gold
- 22
- Messages
- 308
- Location
- USA
- Discord Unique ID
- 804740920511561790
- Discord Username
- CPT72BUG
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*
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*

