By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,798 Members | 1,378 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,798 IT Pros & Developers. It's quick & easy.

why we require Class.forName , getConstructor , newInstance methods

P: 5
i cant able to understand following code , can any one please explain this code

----------------------------------------------------
Class flow = Class.forName("com.test.src");
Constructor flowcons = flow.getConstructor(null);
m_objFlowChartPane = (JComponent) flowcons.newInstance(null);
m_objFlowChartLoad = m_objFlowChartPane.getClass().getMethod("setNode", new Class[] { Vector.class });
return m_objFlowChartPane;
------------------------------------------------------
Mar 9 '12 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
Why do you need to understand it?
start by reading introductory Java tutorials to understand Java syntax.
Mar 9 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.