answersLogoWhite

0


Best Answer

-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. )

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is public static final variable in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you interchange the term public and static in java?

The two are different, and independent from one another. A variable can be public, static, both public and static, or neither.


Are static variable created by giving keyword static in java?

yes bcoz static variables


WAP to show the difference between a variable and static variable?

difference between constant and static variables in java


What happens when two objects try to modify static variable in java?

class Demo { static int a=10; } class Demo1 { public static void main(String[] args) { Demo d1=new Demo(); Demo d2=new Demo(); d1.a=20; d2.a=30;//this is the final value stored in that static variable } } Finally what i want to say is whenever we modify static variable by two objects the value stored in that variable is the value given by last object.


What is static java most commonly used for?

Static java method is the same as a static variable. They belong to a class and not an object of that class. If a method needs to be in a class, but not tied to an object, then one uses static java.


How do you declare symbolic constants in Java?

Symbolic constants are named constants like : final double PI = 3.14 ; They are constants because of the 'final' keywords, so they canNOT be reassigned a new value after being declared as final And they are symbolic , because they have a name A NON symbolic constant is like the value of '2' in expression int foo = 2 * 3


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....


What are static objects in java?

There is no separate entity as a static object in java. The static keyword in java is used to signify that the member (either a variable or a method) is not associated to an object instance of the class. It signifies the fact that the member belongs to the class as a whole. The words static and objects are opposites of one another so you cannot have a static object. However, you can declare an object as a class level variable which could be referred to as a static object but it will be referred to as a static or class variable and not a static object.


what type of variable is visible to every module and the entire program?

If you are talking about a class in Java, a variable encapsulated by a class is called an instance variable b/c everytime you create an object with that class, each object has its own set of the variables declared.


What is psvm in java?

public static void main


Is it legal in java to modify a variable in a static method?

It is, provided that the variable is also static or you're referencing the variable through an instance of you class. class MyClass { static int staticVariable; int memberVariable; public static void main(String[] args) { // This is legal. staticVariable = 10; // This is not legal. memberVariable = 10; // This is legal. MyClass mc = new MyClass(); mc.memberVariable = 10; } }


In java public static voidmain function denotes what?

Java's main function denotes the entry point into the execution of your program.