Admin shares only permit access over the network to users that are members of the computer's local
Administrators group. You can disable them by configuring the
AutoShareServer (for server OS) or
AutoShareWks (for non-server OS) registry values:
AutoShareServer (server OS) or
AutoShareWks (for non-server OS)
There may be negative implications for disabling them--see https://support.microsoft.com/en-us/kb/842715.
Your teacher may be misunderstanding the scope of this feature. As noted, the admin shares are only accessible to members of
Administrators (hence the name). If someone is a member of
Administrators that is not supposed to be a member of
Administrators, they already have the highest level of access anyway. Another way to say this: Disabling the admin shares doesn't prevent hacking; if a hacker can access them, you've been hacked already.