Buying buildings to make profit by renting them out

A: It is permissible to buy real estate for investment whether by renting them out or something like that. As for the public sector businesses, this term is general and we need further information about its transactions in order to be able to answer the question. May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.