Start of Tutorial > Start of Trail |
Search
Feedback Form |
Software development tools, such as GUI builders and debuggers, need to manipulate objects at runtime. For example, a GUI builder may allow the end-user to select aButton
from a menu of components, create theButton
object, and then click theButton
while running the application within the GUI builder. If you're in the business of creating software development tools, you'll want to take advantage of the reflection API features described in this lesson.This lesson has the following sections:
How can you create an object if you don't know its class name until runtime? You'll find the answer in this section.
In this section you'll learn how to get the values of an object's fields, even if you don't know the name of the object, or even its class, until runtime.
Not only can you get field values at runtime, you can also set them. This section shows you how.
This section shows you how to dynamically invoke methods. Given an object, you can find out what methods its class defines, and then invoke the methods.
Start of Tutorial > Start of Trail |
Search
Feedback Form |
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.