everyone here is giving one line answers like i normally do!
if you want to call a method on a java class you must be doing that over some kind of network connection to a web server.
the web server can run pretty much any servlet container (jboss, tomcat, orion, jetty) and the java web app should include any one of (red5, livecycle data services, web orb) remoting libraries.
you should return a simple types in the begining (Object, string, boolean, number) or an object consiting of simple types all in the "public" namespace ("value object"/POJO). ideally no constructer args.
this class should map to an actionscript class with the same signature (the same properties) on the client side, and you need to either use registerRemoteAlias in code or in flex the remote alias meta data tag. to tell the flash player that this bunch of bytes serializes into a specific class.
instantiate a java class in actionscript - > rewrite