Class of the Month: The Reflection API Minnesota

A number of popular Java technologies and frameworks depend on the Reflection API to function. Learn more about its many uses.

Local Companies

3 Sixty Software, LLC
612-961-0787
4209 Heathcote Rd
Wayzata, MN
Lawson Software
651-767-7000
380 Saint Peter St
St. Paul, MN
Automation Station Inc
651-224-1985
180 5th St E
St. Paul, MN
Notion IT
(507) 276-9149
820 Sunrise Dr.
New Ulm, MN
Genuine Genuis Solutions
(612) 872-4256
431 Clifton Ave
Minneapolis, MN
Twin Cities Solutions, Inc.
952.881.6570
10800 Lyndale Ave S
Bloomington, MN
American Software and Global Technologies
(952) 885-5640
1650 W 82nd St
Minneapolis, MN
Assessment Systems
651-647-9220
2233 University Ave W
St. Paul, MN
Global Software
(612) 305-4472
10 S 5th St
Minneapolis, MN
Productive Corporation
612.375.0204
510 First Ave North Suite 310
Minneapolis, MN

provided by: 
Originally published at Internet.com


Java classes are the main building blocks of a Java application. As developers, we write some classes, but we also use classes developed by others. We rely on the API listings and documentation to learn how to use these "third-party" classes effectively. That works well (at least as well as the quality of the documentation!) in development stages. Java also provides a framework for learning about classes during runtime. That framework is called Reflection and is wrapped as the java.lang.reflect package.

Piroz Mohseni

A number of popular Java technologies/frameworks depend on the Reflection API to function. For example, a JavaBean container uses the Reflection API to learn about the properties and methods of a Bean. Reflection is also used in Remote Method Invocation. With the introduction of Java/XML binding technologies like JAXB, Reflection may also be used to learn about the structure of an XML document by looking at a "class" representation of an XML document. The following example provides a simple explanation of how the Reflection API could be used.

Consider the sample class called Foo shown below. It has three fields: num, c, and test. It also has two constructors. Note that one of the constructors is non-public. It also has three methods, where one (methodB) is labeled as private. public class Foo { public int num; public char c; String test; public Foo() { num = 2; c = 'b'; test= "test"; System.out.println("Foo constructor"); } Foo(int i) { num = i; c = 'b'; test = "test"; System.out.println("Foo constructor with param"); } public void methodA() { System.out.println("Method A"); } private void methodB() { System.out.println("Method B"); } public int methodC(int i, char c) { System.out.println("i = " + i + " c= " + c); return i; } } ...

Read article at Internet.com site

Featured Local Company

Twin Cities Solutions, Inc.

952.881.6570
10800 Lyndale Ave S
Bloomington, MN
http://www.twincs.com

Twin Cities Solutions, Inc. is a privately owned information technology solutions firm primarily engaged in providing technical and project management expertise to application development initiatives.

We are experienced in providing information technology solutions to government agencies as well as manufacturing, legal, financial and publishing business sectors.

Our team of consultants provides expertise to our clients in several key areas: E-Commerce applications, distributed applications, database development and desktop support.

Regional Articles
- Class of the Month: The Reflection API Albert Lea MN
- Class of the Month: The Reflection API Andover MN
- Class of the Month: The Reflection API Anoka MN
- Class of the Month: The Reflection API Bemidji MN
- Class of the Month: The Reflection API Brainerd MN
- Class of the Month: The Reflection API Burnsville MN
- Class of the Month: The Reflection API Champlin MN
- Class of the Month: The Reflection API Chanhassen MN
- Class of the Month: The Reflection API Chaska MN
- Class of the Month: The Reflection API Circle Pines MN
- Class of the Month: The Reflection API Cloquet MN
- Class of the Month: The Reflection API Cottage Grove MN
- Class of the Month: The Reflection API Detroit Lakes MN
- Class of the Month: The Reflection API Duluth MN
- Class of the Month: The Reflection API Eden Prairie MN
- Class of the Month: The Reflection API Elk River MN
- Class of the Month: The Reflection API Excelsior MN
- Class of the Month: The Reflection API Faribault MN
- Class of the Month: The Reflection API Fergus Falls MN
- Class of the Month: The Reflection API Forest Lake MN
- Class of the Month: The Reflection API Hastings MN
- Class of the Month: The Reflection API Hibbing MN
- Class of the Month: The Reflection API Hopkins MN
- Class of the Month: The Reflection API Inver Grove Heights MN
- Class of the Month: The Reflection API Lakeville MN
- Class of the Month: The Reflection API Mankato MN
- Class of the Month: The Reflection API Minneapolis MN
- Class of the Month: The Reflection API Minnetonka MN
- Class of the Month: The Reflection API Moorhead MN
- Class of the Month: The Reflection API Mound MN
- Class of the Month: The Reflection API New Ulm MN
- Class of the Month: The Reflection API Osseo MN
- Class of the Month: The Reflection API Owatonna MN
- Class of the Month: The Reflection API Prior Lake MN
- Class of the Month: The Reflection API Red Wing MN
- Class of the Month: The Reflection API Rochester MN
- Class of the Month: The Reflection API Rosemount MN
- Class of the Month: The Reflection API Saint Cloud MN
- Class of the Month: The Reflection API Saint Paul MN
- Class of the Month: The Reflection API Savage MN
- Class of the Month: The Reflection API Shakopee MN
- Class of the Month: The Reflection API South Saint Paul MN
- Class of the Month: The Reflection API Stillwater MN
- Class of the Month: The Reflection API Wayzata MN
- Class of the Month: The Reflection API Willmar MN
- Class of the Month: The Reflection API Winona MN

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML