There are 4 different but closely related forms(serotypes) of the flavivirus that cause dengue fever. Once you have been infected by one form of the virus you're immune against that form for the rest of your life. However, infection with one form of the virus doesn't protect you against catching one of the other 3 forms. If you're infected a second time, you will be at greater risk of developing dengue haemorrhagic fever.
Attribution: BUPA