code, programming, hacking @ Pixabay

Labels are used in programming to group a set of related statements. Declarations are not statements, but they do have an effect on the program’s instructions. Labels are used in programming to group a set of related statements. Declarations have no effect on the program’s instructions, but they do need to be true for use within other labels or declarations.

What is the difference between these two?

set, collection, balloon @ Pixabay

Labels can only be part of a statement and declarations are not statements; however, they must still be declared before being used in any label or declaration outside their parent code block.

Labels can also override previous labelled blocks with new definitions by using them again later in the same code structure while declaring a redefinition that overwrites it (you could think about this as if you had renamed something). 

LEAVE A REPLY

Please enter your comment!
Please enter your name here