//Sample code from http://download.oracle.com/javase/tutorial/
class ArithmeticDemo {public static void main (String[] args){
int result = 1 + 2; // result is now 3
System.out.println(result);
result = result - 1; // result is now 2
System.out.println(result);
result = result * 2; // result is now 4
System.out.println(result);
result = result / 2; // result is now 2
System.out.println(result);
result = result + 8; // result is now 10
result = result % 7; // result is now 3
System.out.println(result);
}
}
Additional Example: ---------------------------------------------------------------------------------------
/*
http://j4guiang.blogspot.com/
*/public class ArithmeticDemo2 {
public static void main(String[]args){
int result = 1 + 2; //result variable becomes 3
System.out.println(result + 5); //print the value of result + 5
int num1 = 4,num2 = 2; //new variable num1 and num2
System.out.println(result + num1 - num2); //print the result of (result + num1 - num2)
System.out.println((num1 * result)+num2);//first multiple num1 and result then + num2
result = 77; //set new value for variable result
System.out.println(result);
}
}
Hello brother;
ReplyDeletei will need " insert photo in mysql database using java.
please help me.
please give me this simple sourcecode and database :)
Thanks you very much.