hidden classes

F

Frank

Hello,

Got a small problem in a routine I've written... the code is much to large
to post here, so I'm only asking if anyone has any similar experience.

My routine compiles and executes just fine. However, when I look at the
compiled files, I have one extra anonymous class. I expected to have a top
level, and one inner level member class for a total of 2 classes. Instead
I have a total of 3.

When I disassemble this mystery class with javap -c -private, the result,
in it's entirety is:

Compiled from "MyClass.java"
class MyPackage.MyClass$1 extends java.lang.Object{
}

I erase the .class files, recompile, and the mystery class is again
rebuilt.
Checking my {'s and }'s, I think everything is lining up correctly (unless
my eyes decieve me).
Running javadoc on my code looks like all methods, fields are being
assigned to their appropriate enclosing classes.

Now the kicker: after compiling, I erase the mystery .class file, and
execute the program with no problems.

What could be causing the compiler to create extra files?

Thanks,

Frank
 
F

Frank

Sorry, stumbled across my answer on another forum. It had to do with my
private member class having a private constructor. Fixed that and no more
surprises from the compiler :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top