Welcome to another guide by me 
I will be demonstrating how to compute to numbers to get the product of the numbers.
Shall we start?
From my other guide you will have learn't to define a class.
Start with this:
Just like before we shall add
Now to call the numbers we will need to use the Integer method, Remember Integers will be the main statement you will use.
Add this:
This will declare that a variable will be used as a int and it will be called num
Time to assign a number to it:
Now lets print that bit out
Now time to assign a second set to Multiply num
Ok now time to print the whole thing out!
}
}
If you read my previous guide you will have learnt how to compile a program. So compile this and now open it up.
Your output display should show:
This is num: 100
The value of num * 2 is 200
num will be 100 so you will have multiplied 100 * 2
Hope you enjoyed this guide!
I will be demonstrating how to compute to numbers to get the product of the numbers.
Shall we start?
From my other guide you will have learn't to define a class.
Start with this:
Code:
class Compute {
Just like before we shall add
Code:
public static void main(String args[])
Now to call the numbers we will need to use the Integer method, Remember Integers will be the main statement you will use.
Add this:
Code:
int num;
This will declare that a variable will be used as a int and it will be called num
Time to assign a number to it:
Code:
num = 200;
Now lets print that bit out
Code:
System.out.println("This is num: " + num;
Now time to assign a second set to Multiply num
Code:
num = num * 2;
Ok now time to print the whole thing out!
Code:
System.out.print("The value of num * 2 is ");
Code:
System.out.println(num);
}
}
If you read my previous guide you will have learnt how to compile a program. So compile this and now open it up.
Your output display should show:
This is num: 100
The value of num * 2 is 200
num will be 100 so you will have multiplied 100 * 2
Hope you enjoyed this guide!










