Tuesday 27 October 2015

Java Tutorial : Java Unary Operators


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
UnaryOperatorDemo.java
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);

    }
}
Output
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
To Download OperatorsDemoUnaryApp Project Click the below link
https://sites.google.com/site/javaee4321/java/OperatorsDemoUnaryApp.zip?attredirects=0&d=1

See also:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment