What do you mean by Local variable and Instance variable?
Local Variables | Instance Variables | |
---|---|---|
1. | Declared in constructor, method or block. | Declared in a class |
2. | Not possible to use access modifiers | Access modifiers can be given |
3. | Visible within the declared method | Visible for all methods |
4. | No default value | Have default values |
BY Best Interview Question ON 13 Jan 2019