File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Reflection on self Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Reflection on self

Jay Richards
Ranch Hand

Joined: Jan 16, 2003
Posts: 58
Hi. I need to call a method from the class it self i.e.

public class Demo{

//call a method with parameter
public void execute(String methodName,HashMap params){
//example methodName=sampleMethod1
//i need to call the sampleMethod1 method from this class

//call a method without a parameter
public void execute(String methodName){
//example methodName=sampleMethod2
//i need to call the sampleMethod2 method from this class

//method to be called
public void sampleMethod1(HashMap params){

//method to be called2
public void sampleMethod2(){

Hope someone could show me. thanks a lot in advance.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Please don't post the same question if multiple forums. We want to see the discussion take place in one place so people don't waste time replying without seeing what others have already said. Followups go here. Thanks.
[ May 02, 2005: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Reflection on self
It's not a secret anymore!