A VLAN is a logical broadcast domain that can span multiple physical LAN segments. It allows an administrator to group together stations by logical function, by project teams, or by applications, without regard to physical location of the users.
For example using a student like you.
The students in a school are divided into two groups. In the first group, each student is given a red card, for identification. In the second group, each student is given a blue card. The principal announces that students with red cards can only speak to other students with red cards and that students with blue cards can only speak to other students with blue cards. The students are now logically separated into two virtual groups, or VLANs.
Using this logical grouping, a broadcast goes out only to the red card group, even though both the red card group and the blue card group are physically located within the same school.
This example also shows another feature of VLANs. Broadcasts do not forward between VLANs, they are contained within the VLAN.