FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


java help:how does dynamic instantiation of classess happen?





anmol
i want to dynamically instantiate a class . ie i dont want to hard code the instantiation of class(creation of object) how do it achieve it ?
AftershockVibe
How do you want to instantiate it then? Under what conditions?
anmol
conditions ?
i didnt understand ....
i want to create instances of class without hard coding it (ie without writin the statement
class_name object_name=new class_name();

coz i want to make the code more maintainable .. so when new classes r introduced i need not update my code .. just update the config files
mschnell
Um, maybe from what I'm seeing you want an object created every time something in particualar happens? Say it's a button you can press. If you mean this, you should instantiate the object in a button's action listener rather than in the main method. Basically, from what I'm reading, I'd just tell you to instantiate the object wherever it's creation is needed in the code. Perhaps I'm just not understanding you and you already know that.
Related topics
Java Help
Java BlueJ - any help?
Java project coupling problems
Learning: Java Programming
java help
JAva HELP
how many of the four cardinal virtues do you practice?
Dijkstra algorithm implemented in JAVA c or C++
Homosexuality, is it biologically natural?
What went wrong?
Server 2 down again?
Ways to make hell good?
JAVA queries
GIMP :: Creating a new image
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.