Pregunta de entrevista de Broadcom

1. static variables?

Respuesta de la entrevista

Anónimo

19 sept 2010

Variables that have only one copy per class are known as static variables. They are not attached to a particular instance of a class but rather belong to a class as a whole. They are declared by using the static keyword as a modifier. For example: static type varIdentifier; where, the name of the variable is varIdentifier and its data type is specified by type. Static variables that are not explicitly initialized in the code are automatically initialized with a default value. The default value depends on the data type of the variables.

2