user image

Pooja Sharma

Job Interview Skills
English
2 years ago

27. What is the difference between declaring a variable and defining a variable?

user image

Abhishek Mishra

2 years ago

In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization. Example: String s; is just a declaration while String s . new String ("abcd"); Or String s . "abcd"; are both definitions.

Recent Doubts

Close [x]