Dear friends...
Can any one tell me what should I do to access the watch() method using the object obj in the following program.
Your suggestion are highly welcomed.
***********************************************************************
public class Manoj
{
String you="YOU";
Manoj()
{
System.out.println("In const");
}
public void watch()
{
System.out.println("In Watch");
}
public static void main(String a[]) throws
InstantiationException,IllegalAccessException
{
try
{
Object obj = Class.forName("Manoj").newInstance();
//obj.watch();
//System.out.println("Your Entered String: "+obj.you );
}
catch(Exception e)
{
System.out.println("Ex: "+e);
}
}
}
*********************************************************************
Can any one tell me what should I do to access the watch() method using the object obj in the following program.
Your suggestion are highly welcomed.
***********************************************************************
public class Manoj
{
String you="YOU";
Manoj()
{
System.out.println("In const");
}
public void watch()
{
System.out.println("In Watch");
}
public static void main(String a[]) throws
InstantiationException,IllegalAccessException
{
try
{
Object obj = Class.forName("Manoj").newInstance();
//obj.watch();
//System.out.println("Your Entered String: "+obj.you );
}
catch(Exception e)
{
System.out.println("Ex: "+e);
}
}
}
*********************************************************************