Hi, we know the difference between declaration and definition:
-declaration: no memory is allocated.
-definition: memory is allocated.
In C/C++ if we want to define a variable we can make
int x;
or
int x = 5;
(we assign a value too)
while, if we just want to declare we can make
extern int x;
Is there a way in java to simply declare a variable? According to me just arrays can be declared with
String[] arrayString;
while istructions like
String myString;
are definition as they allocate at least a String reference on the stack...am I wrong?