This problem happens to every owner. They buy a bird and name it Jerry and after a few days find out that Mr. Jerry has laid an egg. So how do you determine Mr. Jerry's sex?
There are many ways in which you can determine the sex of a bird. Like observing whether it lays eggs or not. You could conduct a blood test even where the sex of the bird could be determined by observing the chromosomes.
Then there is surgical sexing where you insert an endoscope into the cavity of a bird and notice the ovaries or testes. Then there is a method of analysing the faecal steroid. Then you could also determine the sex of a bird by analysing a newly grown feather in a laboratory and search for male or female chromosomes.
Some birds can be sexed visually, but it varies by the type of bird, some show no difference when you look (Most lovebirds), and on the extreme other end is the Eclectus parrot, the males are all green, and the females red!