Click here to watch in Youtube :
https://www.youtube.com/watch?v=SRtVvkFGXaA&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Arithmetic Operators |
class ArithmeticDemo { public static void main(String[] args) { int addedValue = 1 + 2; System.out.println("1 + 2 = " + addedValue); int subtractedValue = 2 - 1; System.out.println("2 - 1 = " + subtractedValue); int multipliedValue = 2 * 2; System.out.println("2 * 2 = " + multipliedValue); int diviedValue = 4 / 2; System.out.println("4 / 2 = " + diviedValue); int remainderValue = 5 % 2; System.out.println("5 % 2 = " + remainderValue); String firstString = "Hi"; String secondString = " Welcome John."; String thirdString = firstString+secondString; System.out.println(thirdString); } }
1 + 2 = 3 2 - 1 = 1 2 * 2 = 4 4 / 2 = 2 5 % 2 = 1 Hi Welcome John.
https://sites.google.com/site/javaee4321/java/OperatorsDemoArithmeticApp.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment