In This Example I'm Trying To Explain Pre-Increment , Post-Increment , Operators and How They Behave.
Following "JavaOpeartors.java" File Shows The Outputs.
class JavaOpeartors {
public static void main(String args[]){
int No1 = 10;
System.out.print("Initial No1 : ");
System.out.println(No1);
++No1;
System.out.print("Pre Increment ++No1 : ");
System.out.println(No1);
System.out.print("Post Increment No1++ : ");
System.out.println(No1++);
System.out.print("After Post Increment No1 : ");
System.out.println(No1);
No1 = No1 + 3;
System.out.print("No1 + 3 : ");
System.out.println(No1);
No1 += 10;
System.out.print("No1 += 10 : ");
System.out.println(No1);
No1 -= 5;
System.out.print("No1 -= 5 : ");
System.out.println(No1);
No1 *= 2;
System.out.print("No1 *= 2 : ");
System.out.println(No1);
}
}
OutPut
Initial No1 : 10
Pre Increment ++No1 : 11
Post Increment No1++ : 11
After Post Increment No1 : 12
No1 + 3 : 15
No1 += 10 : 25
No1 -= 5 : 20
No1 *= 2 : 40
Subscribe to:
Post Comments (Atom)
JWT Token Decode Using Jquery
When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...
-
In this blog post Ill explain you the logic behind the Sri Lankan National Identity Card (NIC). Sri Lanka now has Old NIC No Format as well ...
-
In This Article I Will Demonstrate You To Create A Simple Chat Program Using Java Remote Method Invocation(RMI). Following Program Supports ...
-
In a windows form application sometimes you may want to import a excel file to a data grid view. In this blog post Ill demonstrate to you gu...
No comments:
Post a Comment