Just to add;
A hub only replicates and sends the information to everything connected to the hub, Which causes a lot of traffic collisions and problems.
A switch sends the data to the correct device, Eliminating all the problems that hubs have. Switches can handle much more traffic. A simple way to describe the switch is a set of traffic lights, but pointing the traffic in the right direction.
Hubs are being slowly phased out, as they are definately not good for a network