Organizational Research By

Surprising Reserch Topic

Question:What is the difference between declaring a variable and defining a variable?



asked Sep 13, 2013 in Java Interview Questions by anonymous
edited Sep 12, 2013
0 votes
49 views



Related Hot Questions

2 Answers

0 votes
In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization. e.g String s; is just a declaration while String s = new String ("abcd"); Or String s = "abcd"; are both definitions.
answered Sep 13, 2013 by anonymous
edited Sep 12, 2013
0 votes
In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization. e.g String s; is just a declaration while String s = new String ("abcd"); Or String s = "abcd"; are both definitions.
answered Sep 13, 2013 by anonymous
edited Sep 12, 2013

...