Explain Declaration and initialization

Declaration and initialization: It is a statement in which a variable is declared and instantly given its initial value. Three illustrations of declaration and initialization are as follows:

    int numStudents = 23;
    Ship argo = new Ship();
    Student[] students = new Student[numStudents];

Instance variables which are not explicitly initialized whenever they are declared contain a default initial value which is suitable to their kind. Uninitialized local variables contain an undefined initial value.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.