Is 'Japanese' in 'the Japanese' (people from Japan collectively) a noun or an adjective?

In a comment BillJ wrote:

In your examples, "Japanese" is an adjective in a 'fused-head' construction. "The Japanese" is then a noun phrase used generically and determined by "the", where the head and the modifier "Japanese" are 'fused' into the single word "Japanese". We understand it to mean the inhabitants of Japan.

Other commenters have mentioned the concept of nominalized adjectives. This accounts for why people can say “the Japanese” to mean the Japanese people, but “*a Japanese” sounds funny. You see the same thing when folks refer to “the old” but where again “*an old” is ungrammatical.

The OED writes that Japanese as a noun is:

Formerly as true n. with pl. in -es; now only as adj. used absol. and unchanged for pl.: a Japanese, two Japanese, the Japanese.

In the Wikipedia article on nominalized adjectives, they write:

The most common appearance of the nominalized adjective in English is when an adjective is used to indicate a collective group. This happens in the case where a phrase such as the poor people becomes the poor. The adjective poor is nominalized, and the noun people disappears. Other adjectives commonly used in this way include rich, wealthy, homeless, disabled, blind, deaf, etc., as well as certain demonyms such as English, Welsh, Irish, French, Dutch.

See also this answer.