Thread: JAVA 101 help
View Single Post
  #2   Spotlight this post!  
Unread 31-10-2016, 08:47
Ethan_P Ethan_P is offline
Registered User
FRC #1895 (Lambda Corps)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Virginia
Posts: 3
Ethan_P is an unknown quantity at this point
Re: JAVA 101 help

You have (door == "t"), this is not recommended.

Strings are objects, unlike ints and other primitive types. And because Strings are objects, you can't use '==' to compare two Strings. You would need to use
string1.equals(string2);
Reply With Quote