Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Incompatible types required boolean found string

user7188033Oct 8 2012 — edited Oct 9 2012
I am trying to set a value for a variable called Location when ever the value for the location is "AFRICA"
I need to reset it to be "55555".

What I am getting is that 'Incompatible types required boolean found string' under the if statemant. Can anyone shade some light on this?

String Location = filename.substring(12,17);
String AP = "AFRICA";
System.out.println(Location);
if (Location = AP)
{
System.out.println(Location);
Location = "55555";
}

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2012
Added on Oct 8 2012
6 comments
1,361 views