answersLogoWhite

0

The use of final denotes that a variable is a constant. For example:

final int PI = 3.14;

makes PI a constant. This is useful because now PI can't be changed, even accidentally, by you, the program, another programmer, or a user. Once a value is final, it is permanent, and can be used as a constant.

Note: usually programmers capitalize the names of constants, just to make it clear that the value is a constant.

User Avatar

Wiki User

∙ 14y ago
User Avatar

What else can I help you with?

Related Questions

Is unsigned integer constant are available in Java?

yes use the final keyword, normally variables declared final use all capital letters but this is not required final int A = 10;


Do you use virtual functions in Java?

Every method in java that isn't a class (static) method is automatically "virtual." If you want to disable virtual overrides, make the method "final" in the base class.


What are sealed classes in java?

Final classes are sealed classes in java I guess.


What is public static final variable in java?

-Public to all - Static to access with Class Name - Final to change( constant and not alowed to change) Just use it along with class name. (As implied above, a 'public static final' variable in Java is what other languages would call a Constant. )


What modifier do you use to prevent that class from having any subclasses?

In Java, you use the final modifier to prevent a class from having any subclasses.


How does the final keyword affect the behavior of Object type in Java?

In Java, the final keyword specifies that the object created cannot be further redefined or derived.


Can you make a class final in java?

yes of course... using the final keyword


How do you prevent class extending in java?

Declare the class as final. final class A{ ... }


Can you declears static in a local variable in a method in java?

we cannot use the staic keyword inside the method... But we can use the final keyword inside the method....


Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


Final classes in java?

A class declared as final means that no other class can inherit from it.


What is the return type of finally method in java?

The final and finally keywords have no impact on the return type of a method in Java.

Trending Questions
What causes a diode to fail on a 240v solenoid valve? What does 820 stamped on an ear ring stud mean? Explain how to check that the replacement components meet the required specificationoperating conditions (such as values tolerance current-carrying capacity ambient temperatures connection orient? Write a Terminate and Stay Resident program in Assembly language to change the background color of DOS-screen after every ten seconds You will need to hook timer interrupt real time interrupt for t? What is protocol analyzer? What is high-level language compiled? Who are the members of the pnp due for attrition? Is 24.0 mfd a good test reading for a 24.5 mfd run capacitor with a multimeter? How do you convert a char to an integer in Visual Basic 2010? How does the steam power compare to power created by running water? What is encapsulate? How is a ventricular shunt inserted? Will inch and a half pipe have enough run off for a shower drain? How do you write a program in c plus plus to swap each half of an array? Increase hot water pressure? A pulsed laser produces 47mj per pulse. The pulse repetition time is 2.5ms and the duty cycle is .008. Find the pulse duration? Why pipe is important? Does the subway work when the power's out? What is that thing called that you pump with your hands and it blows air onto the fire that you are trying to start in the fireplace? An electric motor under steady load draws 9.7 amperes at 110 volts delivering 1.25 hp of mechanical energy What is the rate of the heat transfer from the motor in kW?