answersLogoWhite

0

A constant and variable are variations of data types.

int a;

is a variable and its value can be changed by the program as the program runs.

const int b;

is a constant with a fixed value and will have its value set and may not be changed by the program as as the program runs.

All data types may be declared as a constant.

Variable Value Can Be Changed By You In Programme.

User Avatar

Wiki User

10y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
ReneRene
Change my mind. I dare you.
Chat with Rene
More answers

A constant is a symbol that cannot be modified by the program while it is running, while a variable is a symbol that can be modified by the program while it is running. Constants are usually optimized as inline values, while variables will be stored on the stack or the heap.

User Avatar

Wiki User

12y ago
User Avatar

A constant is a term used in java whose values doesn't change during the execution of the program, while, a variable's value can be changed during the execution.

User Avatar

Wiki User

15y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Difference Between Variable And constant
Write your answer...
Submit
Still have questions?
magnify glass
imp