That's to be expected. The reasoning is this:
If you create a variable and never use it, it's not necessarily a problem. It's not exactly useful, but there are uses for allowing this to happen....
Type: Posts; User: helloworld922
That's to be expected. The reasoning is this:
If you create a variable and never use it, it's not necessarily a problem. It's not exactly useful, but there are uses for allowing this to happen....
No object is created, it is simply a floating reference.
public class Test
{
public Object o1;
public static Object o2;
To clarify aussiemcgr's answer, the variable is kind of set to null. The java compiler is smart enough to recognize here that object has never been initialized and will by default throw a compile...