This is very difficult with java sparrows, as the coloration is
pretty much identical.
1. The Male Java Sparrow is the only one that sings.
2. The beak on the male tends to look 'swollen' and a bit
thicker than the hens.
The link below is a pretty good starting point.