Click here to watch in Youtube :
https://www.youtube.com/watch?v=qLAFniod4wo&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Unary Operators |
class UnaryOperatorDemo { public static void main(String[] args) { int unaryPlusValue = +1; System.out.println("unaryPlusValue : " + unaryPlusValue); int k = 90; int unaryMinusValue = -k; System.out.println("unaryMinusValue : " + unaryMinusValue); int i = 1; System.out.println("Before incrementing, value of i : " + i); i++; System.out.println("After incrementing, value of i : : " + i); int j = 6; System.out.println("Before decrementing, value of j : " + j); j--; System.out.println("After decrementing, value of j : " + j); boolean success = false; // false System.out.println(success); // true System.out.println(!success); } }
unaryPlusValue : 1 unaryMinusValue : -90 Before incrementing, value of i : 1 After incrementing, value of i : : 2 Before decrementing, value of j : 6 After decrementing, value of j : 5 false true
https://sites.google.com/site/javaee4321/java/OperatorsDemoUnaryApp.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment