Explicit type casting.

1999-11-03 Thread SABYASACHI S GUPTA
I have 3 files to test this. //A.java public class A { public void method(){ System.out.println("In A"); } } //B.java public class B extends A { public void method() { System.out.println("hello world"); } } //mymain.java

query

1999-11-03 Thread SABYASACHI S GUPTA
In java explicit typecasting is allowed. Now if I have 1. Instance of Base class 2. Name of derived class Can I call a method of a derived class object through the base class instance. theComponentApp = selAppComp[i].getInstance(); //Base class instance. try{ String compName = selApp

Re. about Class class

1999-01-02 Thread SABYASACHI S GUPTA
Yup I figured that out ... but how do I do a typecast when I have the class name in a String variable during runtime. (I do NOT know the class name to typecast). On Thu, 4 Nov 1999, Nathan Meyers wrote: > Nathan Meyers wrote: > > SABYASACHI S GUPTA wrote: > > > >

Re. about Class class

1999-01-02 Thread SABYASACHI S GUPTA
Yup I figured that out ... but how do I do a typecast when I have the class name in a String variable during runtime. (I do NOT know the class name to typecast). On Thu, 4 Nov 1999, Nathan Meyers wrote: > Nathan Meyers wrote: > > SABYASACHI S GUPTA wrote: > > > >

about Class class.

1999-01-02 Thread SABYASACHI S GUPTA
I dont know this might be something very simple... so please excuse me. I have the following small code. public class saby { public static void main(String args[]) { String s = "myclass"; Class c = new Class(); try {