The value changed at 'i++' is never used.
This inspection points out the cases where a variable value is never used after its assignment, i.e.: - the variable never gets read after assignment OR - the value is always overwritten with another assignment before the next variable read OR - the variable initializer is redundant (for one of the above two reasons)
Dave Tolls wrote:The post-increment operator returns the value before the increment.
So i is 0 initially, i++ will return 0, so i = i++ will reset i back to zero after the increment.
ras oscar wrote:See post 14 in this thread. The only thing I have changed is to remove all the import statements from the top of the 2 files. The compiler runs without complaint and emits the 2 expected classes. The run program ( runner?) complains it can't find the data class. All files are located in the same directory, both .java and .class (And .bat, if it matters). The files are all located in c:\Java\Command Line\Data
ras oscar wrote:is there a java system design reason why the compiler will look in the current directory but the run application won't? I assume the "application deployment" solution would be to combine all the required classes into a .jar file and run that. No?
Tim Holloway wrote:Or, if you prefer: "java -classpath=. Data" which you can abbreviate to simply "-cp".