• 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

rules round up question.

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had some time and played the rules round up. One of the question has me puzzled. Hoping someone could provide me with an explanation. I don't have the exact wording but the gist

Given a Class (outer) with a private method and an inner class (inner). Can the inner class redefine behavior of the private method in the outer class.

Are they talking of something like... (if so why would you ever want to do this
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Methods and varialbles of outer class can be accessed
directly by inner class.
But inner class variables and methods can't be accessed by outer class directly and
inorder to access, inner class should be instansiated in outer class then only inner class methods can be used.

So here we can define same function with 2 different
functionalities,just like overriding.
reply
    Bookmark Topic Watch Topic
  • New Topic