• Log in or sign up for an account here: https://www.sythe.org/login

A Day 2 Exercise In Learning Java

jamesm201

Forum Addict
Joined
Feb 7, 2011
Sythe Gold
22
Messages
308
Location
USA
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*
 
thanks dude i kind get blinded with those colored peaces with the /brown/color stuff that this fourm has
 
Runescape Gamblingrunescape gambling
Back
Top