I thought that an uninitialized variables are set to null by default example shown below:
Public class foo{
Object bar;
public void check(){
while(bar != null){
// Do something
}
}
}
Inside the method I am getting an error about checking an uninitialized object. But by default Java would set this to null? Thanks