Alexander:
Welcome to JavaRanch!
No, your question is not dumb
. The reason why you're getting 5, is that the postfix increment happens after the assignment. So, in your example what happens is:
You create x and assign it a value of 5:
You then assign x the value of a temporary variable equal to x++. In detail, you are assigning x the value of the temporary variable, then incrementing the temporary variable (which gets dropped):
Naturally, when you print it out, you get 5
If you want to get six, you probably should just do this:
John.