File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anonymous class-please reply.

 
hema janani
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help.
*******1.what is the valid innerclass?
a.new complex Interface(x){}
what RHE has to say about this is "if an anonymous class extends existing class,rather than implementing an interface,then argument for the superclass constructor may be placed in the argument part.
but
"if an Anonymous classes that implements interface ,it is imposssible to use any arguments in the new part for these classes.
so I feel that the option a is not a valid one.
2.does Interrupted exception stops the thread from executing.please reply in yes & no?no nonending explanations please.
I have already read the previous thread ,but it becomes all the more confusing.
 
Ying Xing
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi hema janani,
For your question 1, just as you have mentioned "if an anonymous class extends existing class,rather than implementing an interface,then argument for the superclass constructor may be placed in the argument part." Here, the complexInterface refers an EXISTING CLASS, so the construction of the anonymous class "new complex Interface(x){}" is valid.
For your question 2, Interrupted exception can NOT stop the thread from executing.

regards
yingxing
 
hema janani
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you xing ying
oops ying xing
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic