adspace


Explain final, finalize() and finally?

Answer Posted / venkataramana

final is a keyword.
we can use the final keyword in different context.
final keyword can be used with 1.Variables
2.Methods
3.Classes

When we use the final keyword with variables ,the value of
the final variable will not be changed i.e its value will be
fixed .

when we use the final keyword with methods, that is the
final method cannot be overridden.

when we use the final keyword with classes, that is the
final class cannot be extended to subclasses.

Finally() block is followed after try() or catch() block.
Finall() block executed even though if there the exception
having or not in the program.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between equals() and == in java?

1047


Write a program to print count of empty strings in java 8?

1092


Differentiate between static and non-static methods in java.

1131


What is parsing in java?

1046


Realized?

2272


What is a constructor overloading in java?

1131


What do you mean by an interface in java?

1107


What is the difference between break and continue statements?

1131


What is an object in java and how is it created?

1147


What is a classloader in java?

1096


explain different ways of using thread? : Java thread

1089


Write a program to find the whether a number is an Armstrong number or not?

1107


How to create a base64 decoder in java8?

1144


Is minecraft 1.15 out?

1049


What are the differences between heap and stack memory in java?

1151