There are lots of questions and massive confusion on this issue, so I thought I would write a thread.
MJ is unusual among plants, but not unique, in that the plants have two sexes. (Most plants are not like this, they have both male and female organs in the one flower.)
Also, unlike most plants, MJ is pollinated by wind, not insects, and does not then have a brightly coloured flower to attract insects.
The male flower is a sac of pollen, which bursts open to release the pollen to the wind. The female flower is what we call a bud, covered with thousands of pistils, fine hairs coated with trichomes containing sticky THC which catches pollen grains.
When the plant is 6 to 8 weeks old it develops pre-flowers, at the nodes of the plant, that is, where the branches meet the main stem. At this stage, which is long before actual flowering begins, we can identify the sex of the plant.