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 |
What is exception propagation?
How do you set security in applets?
What is scanner in java?
How to convert String into primitive datatype.
What are decalarations?
What is the exact difference in between Unicast and Multicast object ?
what is thread in Java ?
How to restrict a member of a class from inheriting by its sub classes?
When will we use class loader?
Why is sizeof not a function?
What are advantages of exception handling in java?
Explain throw keyword in java?