If I was trying to increase the CRN of a number, I think that the correct way to do so would be to create an instance variable and a static variable
private int crn;
private static int nextCrn = 2015000;
and then to increment it, simply set them equal to each other in the constructor and increment,
public Course() {
crn = nextCrn++;
}
For each time the constructor was called, it would increment the value 2015000 by 1.
Sorry for the confusion, I know that it will compile if you just increment the static variable,
i.e. crn = crn++
It's not the order of operation that is confusing me, but why do we need the instance variable in the first place to store the CRN for certain objects, like a commenter mentioned below. Why can't the static variable just have a different CRN for each object without an instance variable??