• Post Reply Bookmark Topic Watch Topic
  • New Topic

On compiling, I get servlet111$servlet222.class ???  RSS feed

 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I javac-ed a heap of programs, most of which are in the same package.
One extra one was created out of 2 other programs : BaseTunnelClient$TunnelException.class, which was one root cause of my problem because I forgot to deploy that to the web-server.
I seen that before, without understanding it. What is it ???
How did it come about ???
What does it do ???
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean the $ sign, that means that for a$b, b is an inner class of a.
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but why does it create a new .class file ? Where there were 2, now there are 3.
It doesn't always do that
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A class file can only hold one class, therefore for every inner class you declare, the compiler will synthesize a class name following the JLS rules to hold the code.
Bill
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that.
Helps that I know it for deployment purposes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!