A computer virus is a self-replicating program that can damage data, degrade system performance, and steal information. There are various types of viruses categorized by their behavior, including boot sector, file, macro, and multipartite viruses, each with specific methods of infection and examples. Notable examples include the stoned virus (boot sector), cascade (file), melissa (macro), and ghostball (multipartite).