Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is default value of a global and local variable in go?



What is default value of a global and local variable in go?..

Answer / 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

More Go Programming Language Interview Questions

What is range keyword?

1 Answers  


Does go (golang) support pointer arithmetic?

1 Answers  


What is syntax like in go?

1 Answers  


Does golang support operator overloading?

1 Answers  


What is the gopath environment variable?

1 Answers  


How can an entry be deleted from a map?

1 Answers  


Why type assertion is used in go language?

1 Answers  


What is go interfaces?

1 Answers  


What is the default value of a pointer variable in go?

1 Answers  


How a pointer is represented in go?

1 Answers  


Does go programming language support operator overloading?

1 Answers  


What are interfaces to go language?

1 Answers  


Categories