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

Explain the scope of a variable.

0 Answers   TCS,


What is meant by inheritance and what are its advantages?

0 Answers  


when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).

3 Answers  


What is subsequence of a string?

0 Answers  


which pattern is default in scanner package?

0 Answers   Satyam,






Define locale.

0 Answers  


What are daemon Threads in java?

0 Answers   Impetus,


There are 2 different ways to create an object. a)By using keyword "new" b)By using Class.forName ("className").newInstance(); What is the difference between these 2 methods.

3 Answers  


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

0 Answers  


What is meant by vector class, dictionary class, hash table class, and property class?

0 Answers  


Is minecraft 1.15 out?

0 Answers  


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

0 Answers   Amazon,


Categories