Many Western people are not used to sitting on the floor. In Japan, however, sitting upright on the floor is common in various situations. For example, meals are traditionally held sitting on the tatami floor around a low table. Also during the tea ceremony and other traditional events, one sits on the floor.
The formal way of sitting for both genders is kneeling (seiza). People who are not used to sitting in seiza style, may feel uncomfortable after a few minutes, and their legs may get numb. However, foreigners are not usually expected to be able to sit in seiza style for a long time, and an increasing number of Japanese people themselves aren't able to do so due to a westernized lifestyle.
In casual situations, men usually sit cross-legged, while women sit on their knees laying both legs to one side. The former sitting style is considered exclusively male, while the latter is considered exclusively female.