Expression Statements in Java


Expressions have already been mentioned in this tutorial and expression statements are either,

1. Object creation, for example:


MyObject obj = new MyObject();


2. Method calls, for example:


String myString = obj.callingMyMethodThatReturnsString();


3. Increments and decrements, either pre or post, for example:


int i = 0;
int j = 0;

i++;
j--

--i;
++j;


4. Assignment, either with our without an operation:


i = 5;
i *= 5;

Previous     Next

Tutorial Home


db error 115