A type of a virus is determined by the different kinds of targets the virus infects.
Some viruses infect both executables, and master boot records.
These are called Multipartite viruses. Overwriting viruses replace the code of the victim with the virus code, thus destroying the victim irreparably. A resident virus stays in memory after execution. Resident viruses are able to thus spread without the user executing them once they are in memory. Whereas non-resident viruses are able to spread only when the user executes an infected program.