No. Safari does not support Java, and Apple does not allow third party apps to run user entered code. It's one of their security stances. Makes it harder to break a device if you can't enter and run code directly.
However the app CodeToGo will allow you to create/edit code, then compile and run it on their servers. It supports a fairly expensive set of languages, including JAVA.
Not ideal, but if you just need a learning environment or to test code, it may be enough. There is another app that does the same/similar thing, but I can't remember the name.