This usage is correct and precise.
It indicates that there is exactly one variable declared of each type. So the sentence
To demonstrate this, I have declared eight variables, one each of the primitive data types: character, Boolean, byte and so on.
tells you that there are eight variables, they are all different primitive data types, that all of the primitive data types are represented, and that therefore there are eight total primitive data types.
Your alternative sentence
To demonstrate this, I have declared eight variables, each of the primitive data types: character, Boolean, byte and so on.
has less information. It says that there are eight variables, and each of them is one of the primitive data types. It does not say that all eight variables are different types, how many types are in use, or how many types exist. This is because it does not say how many there are of each type.
Alternative Phrasing
If you don't like that phrasing, there is an alternative one you can use:
To demonstrate this, I have declared eight variables, one of each of the primitive data types: character, Boolean, byte and so on.
To me that sounds a little awkward and forced, but I wouldn't suggest that it is 'incorrect'.
If were were talking about something other than variables and types, then using 'for' would make sense rather than 'of', but the particular relationship between variables and types requires using 'of'. Variables are 'of' a type, not 'for' a type.
List Notation
I agree that the list should be preceded with a colon in this instance, but I don't think that it impacts understanding or meaning, and is therefore not that important.
Best Answer
No, we would not say "I slept at 10". (AmE). Either say
I was sleeping at 10. (this means you were also sleeping some before and after 10) or
I {fell asleep/went to sleep} at 10. (means you were not sleeping before 10.)