When we declare an an like
int myInt = 5;
Is myInt is a reference to an object of type int.
Is that setting up a reference to the object the same way as if we setup a class?
StudentClass c = new StudentClass()
c is a reference and it points to the location of our Student Class?
And the only difference how it is treated when passed in paramaters.
I know how class objects work, just trying to understand primitive types.
No, an
intis a value type (i.e. struct), so the variable contains the integer value itself, not a reference to an area where the value is stored.Some more reading: Types (C# Reference)