Declaring Vs Initializing Variables

[Solved] Declaring Vs Initializing Variables | Swift - Code Explorer | yomemimo.com
Question : declaring vs initializing variables

Answered by : friendly-flatworm-v8xnofem1ui0

/*
Declaration of a variable in a computer programming language is a statement
used to specify the variable name and its data type.
Declaration tells the compiler about the existence of an entity in the
program and its location. When you declare a variable,
you should also initialize it.
i.e: let name: String = ; (as long as there is nothing after the equal sign (=)
the variable has been declared.
Initialization is the process of assigning a value to the Variable.
Every programming language has its own method of initializing the variable.
If the value is not assigned to the Variable,
then the process is only called a Declaration.
i.e let name: String = "Hatake Kakashi" (This means the variable name has been
initalized using Hatake Kakashi.
*/

Source : | Last Update : Sat, 08 Jan 22

Answers related to declaring vs initializing variables

Code Explorer Popular Question For Swift