Low-temperature scanning tunneling microscopy and spectroscopy have been performed on an optimally doped La1.84Sr0.16CuO4 single crystal at 4.2 K. The surface topography and the spatial variation of the local density of states have been obtained on the ab plane. Our results reveal a nonuniform distribution of low-energy electronic states and the superconducting gap in real space. The energy gap Delta evolves on the surface in the length scale of 5-10 nm, and ranges from 7 to 17 meV. The mean value of Delta approximate to 10 meV, which gives 2 Delta/k(B)T(c)approximate to 6, is in agreement with the previous results of tunneling and angle-resolved photoemission spectroscopy study. The spectra exhibit similar evolution to that of Bi2Sr2CaCu2O8+delta, suggesting that the electronic inhomogeneity is a common characteristic among high-T-c cuprates. This spatial distribution of Delta in our observation accords with the results of the Cu-63 NQR study when it is attributed to the variation of the local hole concentration.