Ask Question
30 March, 03:05

The programmer must initialize variables when they are declared

+1
Answers (1)
  1. 30 March, 05:11
    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?
Get an answer to your question ✅ “The programmer must initialize variables when they are declared ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers