Progamming by side effect
Consider the following code.
Note: SimpleIO.readIn t() reads an integer from console
1) What are good points? What are bad points?
2) How could the code be rewritten?
Consider the following code.
Note: SimpleIO.readIn t() reads an integer from console
Code:
boolean a,b;
int c,d;
...
c = 10;
if ((d = SimpleIO.readInt()) < c)
{
...
};
2) How could the code be rewritten?
Comment