1

I switched from eclipse to android studio recently. During coding i got some strange behavior. I am having boolean variable where i am passing to if condition like this.

boolean permissionGranted;
if(permissionGranted){
//Do work
}else{
}

It works fine with eclipse. But in android studio it ask me to initialize boolean variable; Error for boolean variable

As per my understanding by default boolean varaible will be intialized to false. Still studio asking me to intialize by myself. What could be the reason behind this?

Gopal Singh Sirvi
  • 4,539
  • 5
  • 33
  • 55
Madhukar Hebbar
  • 3,113
  • 5
  • 41
  • 69

0 Answers0