can anyone give code for a simple java speech recognition program...

Just to clarify the above post, the announcement at the top of the forum says:

Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.

Anyways, never done 'speech recognition' but searching for 'java speech recognition' should turn up quite a few things IMO.

Also, don't think there's anything like a "simple java speech recognition program". That kind of software is pretty advanced.