Having a private struct or class is fine. However, Student should not be a struct. From MSDN:
AVOID defining a struct unless the type has all of the following
characteristics:
- It logically represents a single value, similar to primitive types (
int, double, etc.).
- It has an instance size under 16 bytes.
- It is immutable.
- It will not have to be boxed frequently.
Is Student immutable? No, it has public setters for Name, Age, and Grade. Mutable structs lead to confusing behaviour. To quote an answer on StackOverflow
Structs are value types which means they are copied when they are
passed around.
So if you change a copy you are changing only that copy, not the
original and not any other copies which might be around.
Does Student represent a single value, similar to primitive types? Again, no. Things that would match this criteria include coordinates, rectangles, colours, etc.