Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Difference Between literals and Constants

Former Member
0 Likes
1,199

Can anyone find the difference between literals and constants ?

Can anyone find the difference between literals and constants ?

1 REPLY 1
Read only

Former Member
0 Likes
704

A literal is a value that is expressed as itself. For example, the number 25 or the string "Hello World" are both literals.

A constant is a data type that substitutes a literal. Constants are useful in situations where

  • a specific, unchanging value is to be used at various times in the program