I am trying to access child class variables in parent class..can u suggest me how to proceed
based on below code snippet?
public abstract class Base{
//some abstract methods
//one more method to parse the xml
public final void parseXml(){
String clName = Thread.currentThread().getStackTrace()[1].getClassName(); //child class name
if(xmlFile_+clName){ //i am trying to access "Test.xmlFile_Test",
//execute the if string is available
}
}
}
public class Test extends Base{
public static final String xmlFile_Test = "<Hello>sample</Hello>";
public int execute(){
parseXml(); //This should call base class method
}
}
Where is my wrong step.. this is psuedo code, which might help you to answer
Create a method called
getXMLFile()in the Base class and all its subclasses