Ask Question
13 September, 08:34

The programmer must initialize variables when they are declared

+5
Answers (1)
  1. 13 September, 11:14
    0
    Answer: When you declare a variable, you should also initialize it. Two types of variable initialization exist: explicit and implicit. Variables are explicitly initialized if they are assigned a value in the declaration statement. Implicit initialization occurs when variables are assigned a value during processing.

    Explanation:

    For example, in jа vascript

    var PaintAmount = 50; - declare and initialize

    function setup () {

    creatCanvas (200, 200);

    }

    function draw () {

    ellipse (PaintAmount, PaintAmount) - use the variable PaintAmount

    }

    or rather in Java,

    package random;

    public class something () {

    Public static void Main (String []args) {

    string name; / / this is declaring the variable with the example type

    string name = new string; / /this initializes the declared variable

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “The programmer must initialize variables when they are declared ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers