GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java

 Print  |  
Question:  how and when to prevent inheritance?



February 02, 2006 04:33:38 #6
 kiran   Member Since: Visitor    Total Comments: N/A 

RE: how and when to prevent inheritance?
 

inheritance is prevented when u are sure that your class is a child/leaf and cannot be parent of any other class.U are sure that class is already saturated with functionality and won't be much help by extending it. 

how- use keyword 'final'

     

 

Back To Question