answersLogoWhite

0

What is the difference between variables and constants in java?

Updated: 8/19/2019
User Avatar

Whyumuteme

Lvl 1
12y ago

Best Answer

constant is does not change the value of during the excution of program

variable it changes the value during the excution of program

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Variables can be changed. Constants (declared with the reserved word final) cannot be. They are typically all capitalized.

example: final int FREEZING_POINT=32;

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between variables and constants in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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

difference between constant and static variables in java


What is the major difference between an Interface and a Class?

An interface can only have abstract methods or constants in it. A class can have both that and everything else in Java.


What are the 'Constants' and 'Variables' in Java?

A variable is a memory address that holds a value. A constant is simply a variable that does not change value.


Name a common Java library class that has public instance variables?

The Math class has public variables - defined as final, of course - for the mathematical constants PI and E.


What are the differences between C and Java reference variables?

Java does not have the concept of Reference Variables. We cannot access the memory location where the data is stored in Java.


How are constants and variables important in devoloping java programs?

Without variables, you won't be able to do much programming. Variables is where you store data; such data may change over time. And computer programming is all about manipulating data.


What is difference between java 2 and java 5?

They are different versions. Java 5 is newer than Java 2. Think of it like the difference between the Playstation 1 and the Playstation 3.


Attributes and methods of uppercase in java?

In Java toUppercase() is a method of the class String: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toUpperCase()


Major difference between c and java?

Java is object oriented, C is not...


What is the difference between connectivity in java?

kamina


What is difference between connectivity in java?

kamina


What is the main difference between UNIX and JAVA?

Unix is an operating system, Java is a language.