Javatpoint Logo
Javatpoint Logo

Go Constants

A constant const contains data which is not changed. This data can only be of type boolean, number (integer, float or complex) or string.

Syntax:

Example:

The type specifier [type] is optional, the compiler can implicitly derive the type from the value.

Explicit Typing Example:

Implicit Typing Example:

Go Constant Example

Output:

value of area : 20000

Next TopicGo Type Casting





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA