What is meant by final class, methods and variables?

Answers were Sorted based on User's Feedback



What is meant by final class, methods and variables?..

Answer / narasimha

when you declare a class as final, that class cannot be
extended.In java "String" class is final.

when you declare the variable as final then we can
intialize it only once.it is constant.

when declare the method as final we cannot override the
method

Is This Answer Correct ?    12 Yes 0 No

What is meant by final class, methods and variables?..

Answer / ravikiran(aptech mumbai)

final class:Is the one which cann't be subclassed
final method:Is the one which cann't be overrided
final variable:is the one which acts like a constant

Is This Answer Correct ?    12 Yes 1 No

What is meant by final class, methods and variables?..

Answer / suresh chand

final class: we can't inherit that class

final method: we can't override that method

final variable: we can't change the value of that var.

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More Core Java Interview Questions

What Is Query Throttling in java?

0 Answers   HCL,


What is the list interface in java programming?

0 Answers  


How many bytes is a url?

0 Answers  


What is the difference between Integer and int?

10 Answers   Infosys,


Program to find greatest prime number in n numbers?

3 Answers   Huawei,






How many bits is a char?

0 Answers  


What is the += operator called?

0 Answers  


What is meant by event handling?

2 Answers  


Can a final method be overloaded?

0 Answers  


Which package is imported by default?

0 Answers  


WHAT IS MARKER INTERFACE,AND NO METHODS IS NOT THERE ON THAT INTERFACE THEN WHY WE USED IN JAVA?

3 Answers   L&T,


What is the difference between a constructor and a method?

0 Answers  


Categories