How can final class be used?

Answer Posted / jayant gope

Final is keyword that can be used with class, method and also with the variable.

Class: When final is used with the class, it means that class cannot be further extended or inherited by the other classes. So, final keyword restricts class from being inherited.

Method: When final is used with the method, this means that method cannot be overridden.

Variable: When final is used with the variable, it makes the variable constant i.e. the variable cannot be further modified.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java call by reference?

525


What is your platform’s default character encoding?

551


Can we define private and protected modifiers for variables in interfaces?

576


What is main method?

531


What is the difference between && and & in java?

565






What is lazy programming?

559


How do you find the independent variable?

505


explain the concept of virtual method invocation in polymorphism in detail?

1710


Define Multiprogramming and Multiprocessing in java.

573


How to create an interface?

623


Give us the name of the list layoutmanagers in java?

522


What is difference between static and abstract class?

514


How many bytes are there?

534


Add a value x to array from index l to r where 0 <= l <= r <= n-1

620


Explain illegalmonitorstateexception and when it will be thrown?

608