What is default value of a global and local variable in go?
Answer Posted / Prabhanjan Kumar
The default value of an uninitialized global variable in Go is the zero value of its type. For example, for numeric types like int, float, etc., the default value is 0, while for strings it's empty (""). Local variables are not initialized by default and will cause a compile-time error if used before assignment.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category