• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Anonymous class-please reply.

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you xing ying
oops ying xing
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic