Keywords in Julia are reserved words whose value is pre-defined to the compiler and can not be changed by the user. These words have a specific meaning and perform their specific operation on execution.
'global' keyword in Julia is used to access a variable that is defined in the global scope. It makes the variable where it is used as its current scope and refers to the global variable of that name.
var1 = value1 loop condition statement global var1 = value2 statement end
With the use of global variable, the value of variable x can be accessed from anywhere in the code.
2 4 6 8 10 10
In the above code, it can be seen that the loop will redefine the value of the global variable and when it is called outside of the loop, the updated value is printed.
- Julia local Keyword | Creating a local variable in Julia
- Julia end Keyword | Marking end of blocks in Julia
- Julia function keyword | Create user-defined functions in Julia
- Julia continue Keyword | Continue iterating to next value of a loop in Julia
- Julia break Keyword | Exiting from a loop in Julia
- if keyword - Conditional evaluation in Julia
- Julia return keyword
- try keyword - Handling Errors in Julia
- else keyword in Julia
- Creating array with repeated elements in Julia - repeat() Method
- Creating a view of parent array in Julia - view(), @view and @views Methods
- Creating a copy of elements from a collection to an array in Julia - copyto!() Method
- Creating a similar type of array in Julia - similar() Method
- How to Setup Julia Path to Environment Variable?
- Getting ceiling value of x in Julia - ceil() Method
- Getting floor value of x in Julia - floor() Method
- Getting the minimum value from a list in Julia - min() Method
- Package Management in Julia
- Visualisation in Julia
- Random Numbers Ecosystem in Julia - The Pseudo Side
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.