Different VLANs can't communicate with each other , they can communicate with the help of Layer3 router. Hence , it is needed to connect a router to a switch , then make the sub-interface on the router to connect to the switch, establishing Trunking links to achieve communications of devices which belong to different VLANs.