• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic