Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-15-2007, 04:19 PM
Java Tip's Avatar
Moderator
 
Join Date: Nov 2007
Posts: 1,691
Rep Power: 5
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Default Execution methods – Reflection
One can call methods using reflection at run time. It is a powerful feature which gives Java a huge edge over other programming languages.

Code:
Countries obj = new Countries();
Class c = Class.forName("Countries");
Method method = c.getMethod("methodName");
method.invoke(obj);
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Reflection to run methods JavaForums Java Blogs 1 07-16-2008 04:55 PM
Using reflection to create, fill, and display an array Java Tip java.lang 0 04-14-2008 09:43 PM
Getting class field information using Reflection Java Tip Java Tips 0 01-24-2008 04:20 PM
Getting method names using Reflection Java Tip Java Tips 0 01-24-2008 04:18 PM
Getting methods of a Class - Reflection Java Tip Java Tips 0 11-15-2007 04:18 PM


All times are GMT +2. The time now is 07:48 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org