answersLogoWhite

0

It depends on the language. In C and C++, all static variables are zero-initialised at runtime but local variables are not, thus an uninitialised local variable will hold whatever value happens to reside at the memory allocated to the variable at runtime. However, the C/C++ compiler can be configured to warn against using an uninitialised variable.

In object oriented languages like Java there's no such thing as an uninitialised variable. This is because all Java variables are objects so we must pass the initial value to the object's constructor unless the object has default constructor. Attempting to default construct an object that has no default constructor is a syntax error.

User Avatar

Wiki User

8y ago

What else can I help you with?

Related Questions

What is the difference between a variable and a constant in computer programming?

a constant remains fixed with any kind if change in variation or the quantity whearas variables vary with certain quantitiesa variable is al location in a memory which holds a piece of data ,it can be represented by anything apart from numbers.whearasa constant can be any numbers or charactersif we talk in refernce with C Language:Variable is the named memory location whose value or you can say whose data can be change during execution of program. Where as Constant is the named memory location who value cann't be changed or whose value is fixed during the execution of the program.Variable's syntax is : data_type variable_name; and Constant's syntax is: const data_type constant_name=value;variable's example: int a; Constant's example is:const int a=28;Variables can be initialize after its declaration where as constants must be initialized at the time of there deceleration otherwise they will take a garbage/junk value.


What is local variables default value?

None. If you don't initialize them, you find garbage in them.


How Garbage collection flows and What is a heap memory?

Well, when you make an object, it is stored on the "heap". When that object has no reference variables, it is found by the garbage collector and deleted.


What structures is likely to contain food material or waste?

The garbage bin


What value is stored in uninitialized variables?

The value stored in uninitialized variables is undefined and can vary depending on the programming language and compiler being used. In some languages, uninitialized variables may contain random or garbage values leftover from the memory location previously assigned to them. It is considered best practice to always initialize variables before using them to avoid potential bugs and unpredictable behavior in the program.


How are lysosomes like a garbage collector?

Lysosomes are like a garbage collector because they contain enzymes that break down waste materials such as worn-out cell parts, foreign substances, and toxins. These enzymes help digest and recycle these cellular waste products, similar to a garbage collector removing and processing trash to keep the cell clean and functioning properly.


What is pail of garbage mixture element or compound?

A pail of garbage mixture would consist of elements and compounds. Garbage can contain various elements such as carbon, hydrogen, and oxygen from organic matter, as well as compounds like plastics, metals, and chemicals.


Can plants grow in garbage?

In some cases, plants can grow in garbage if there is enough soil or nutrient-rich material for the roots to access. However, it is important to note that garbage can contain harmful chemicals or pathogens that could negatively impact plant growth. It's generally not recommended to use garbage as a growing medium for plants.


What is the value of the un initialized pointers?

Random garbage, obviously. Let's note that global (ie not automatic) variables are automatically initialized by zero (=NULL)


Garbage man pay rate in Louisiana?

The salary range for a garbage man in Louisiana is anywhere from $17,000 to approximately $28,500. Please keep in mind that salary may vary due to experience in the field, education, geographic location and other variables.


Can empty milk containers into the garbage disposal?

No. The cardboard in milk cartons contain plastic, and your disposal won't enjoy the cardboard.


What do you put in the garbage?

Garbage. You put Garbage in the Garbage.