• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anonymous Inner Classes  RSS feed

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anonymous Inner Classes

I am trying to write Anonymous Inner Classes, this will work

but why I write this similar coding, it is NOT working.

compiler is complaining the Anonymous Inner Classes.

Thanks.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Edward Chen:
...compiler is complaining the Anonymous Inner Classes...

What exactly is the compiler saying?

(Note: You're missing parentheses after "new Callable<Integer>.")
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
...You're missing parentheses after "new Callable<Integer>."

I added some test code around your example, and it looks like those missing parentheses are the problem. This compiles...

Without them, the error is...

Is that what you were getting?
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
Is that what you were getting?

You are right. Thank you very much....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!