Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to restrict a member of a class from inheriting by its sub classes?



How to restrict a member of a class from inheriting by its sub classes?..

Answer / Prayas

"To prevent a member (method or field) from being inherited in Java, use the keyword 'final'.nFor methods: final void myMethod() {n...}nFor fields: private final int myField;"n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is exception propagation?

1 Answers  


How do you set security in applets?

1 Answers   Wipro,


What is scanner in java?

1 Answers  


How to convert String into primitive datatype.

6 Answers  


What are decalarations?

1 Answers  


What is the exact difference in between Unicast and Multicast object ?

4 Answers   Accenture,


what is thread in Java ?

1 Answers  


How to restrict a member of a class from inheriting by its sub classes?

1 Answers  


When will we use class loader?

2 Answers  


Why is sizeof not a function?

1 Answers  


What are advantages of exception handling in java?

1 Answers  


Explain throw keyword in java?

1 Answers  


Categories