Computer Science
Why do you need to declare variables? Explain.
Values & Data Types Java
3 Likes
Answer
Declaring a variable tells Java how much memory it should reserve for storing the variable. Declaring a variable also helps in preventing errors as the compiler can check and flag illegal operations at compile time itself.
Answered By
1 Like