📜  局部变量和实例变量? - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:17.543000             🧑  作者: Mango

代码示例1
First is declaration. Local variable has to be in the block. 
it can be static block or main method block. 
If it is declared in the class not in the block, 
then it is Instance variable. 
Instance variable has a default value is ZERO. 
Local variable if is not initialized there is no default 
value for local variable Instance variable must be called 
through the object into the main method. Instance variable belongs to object
Local variable must be initialized to use but 
Instance variable can get the 0 value or null