Constructing p-n heterojunction is considered as an effective approach to improve gas-sensing performance of nanomaterials, and the general focus is that the formation of a p-n junction can effectively broaden the electron-depletion layer, enhancing the amount of the adsorption oxygen, and being beneficial to the improvement of the gas-sensing performance. However the widening of the depletion layer can only contribute to the improvement of the sensitivity, the effect of p-n junction on other sensing parameters is still not well understood. Herein, the In2O3/Co3O4 core/shell hierarchical heterostructures (In2O3/Co3O4 HHS) are investigated to discern how p-n junction alters the sensing process. The construction of p-n junction can effectively adjust Fermi level, influence the oxidation ability of the adsorbed oxygen and significantly heighten the selectivity of sensing materials, resulting in superior sensing activity. Especially, In2O3/Co3O4 HHS exhibits obviously enhanced gas sensing performance toward formaldehyde at 180 degrees C with high response and good selectivity. Our findings promote the recognition of the important role of electronic structure on gas sensing performance and provide a new strategy to design sensing materials for gas detection. (C) 2020 Elsevier Inc. All rights reserved.