What are constants and how to create constants in java?



What are constants and how to create constants in java?..

Answer / Sumeet Bhandari

Constants are values that cannot be changed during the execution of a program. In Java, they are declared using the final keyword followed by the variable name. For example: final int PI = 3.14; The value of PI can now only be used and not changed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

how to make the double-tone class ? as we have singletone class..?

1 Answers   IBM, Microsoft,


What are constructors in java?

1 Answers  


What is the static keyword?

1 Answers  


Explain all java features with real time examples

1 Answers  


What is sortedmap interface?

1 Answers  


What enableEvents() method do?

1 Answers  


what Data encapsulation in java?

5 Answers  


Can we create a constructor in abstract class?

1 Answers  


Explain the overview of UDP messaging.

1 Answers  


what is difference between abstraction and interface?

8 Answers   FIC,


Write the algorithm to check the number non-leaf nodes in a tree.

1 Answers   Amdocs,


What is a qms manual?

1 Answers  


Categories