• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflections Question  RSS feed

 
Stan Levine
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to run a simple program using the java.lang.reflect package.. The code is:
import java.lang.reflect.*;
public class ReflectInto
{
public static void main(String[] args)
{
Float b = new Float(1);
Method mArray[] = b.getClass().getMethods();
for (int i = 0;i< mArray.length;i++)
{
System.out.println(mArray[i]);
}

}
}
I'm getting the following error:
C:\javapgms>javac ReflectInto.java
ReflectInto.java:9: incompatible types
found : java.lang.reflect.Method[]
required: Method[]
Method mArray[] = b.getClass().getMethods();
^
1 error
Does anyone know what the problem is?
Thanks,
Stan
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!