A firewall prevents people from being able to hack into your computer from outside
A virus program presents harmful software from installing and damaging your computer.
You need to have BOTH installed on your computer as they do totally different things.