---
title: "Discussion on \"Dart Defined Constant using final and const keyword\" | Hashnode"
description: "Discussion on \"Dart Defined Constant using final and const keyword\". 1. final in Dart:\n* Use final when you want to create a variable that can only be assigned a value once.\n* The value is determined at runtime, but once assigned, it cannot be changed.\nExample:\nfinal int myNumber = 42; // myNumber can only be set once..."
url: "https://hashnode.com/posts/dart-defined-constant-using-final-and-const-keyword/65f12b519fd5a0533cd7035b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Dart Defined Constant using final and const keyword](https://jinali.hashnode.dev/dart-defined-constant-using-final-and-const-keyword?utm_source=hashnode&utm_medium=feed)

1\. final in Dart: \* Use final when you want to create a variable that can only be assigned a value once. \* The value is determined at runtime, but once assigned, it cannot be changed. Example: final int myNumber = 42; // myNumber can only be set once...

Mar 13, 2024 · 1 min read · jinali.hashnode.dev  
Updated Mar 19, 2024  
Read the article

-   [#final-keyword-and-const-keyword](https://hashnode.com/tag/final-keyword-and-const-keyword)

## Written by

[Jinali Ghoghari](https://hashnode.com/@JinaliInFlutterLand)

@JinaliInFlutterLand

  
[View profile](https://hashnode.com/@JinaliInFlutterLand)

Flutter Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
