📜  声明 vs 初始化变量 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:00.284000             🧑  作者: Mango

代码示例1
/*
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.
*/