View Single Post
  #4   Spotlight this post!  
Unread 09-01-2017, 09:50
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 150
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: Robot will not drive when using UDP in autonomous

Quote:
Originally Posted by euhlmann View Post
You may be running into a Java subtlety here.

Code:
boolean eq = ("abc" == "abc");
System.out.println(eq); // false!
I'm not entirely sure, but it may be the same problem in your switch statement. Try using String.equals in an if-else instead.

Otherwise, use the debugger to verify that sentence contains the "a" or "b" you need.
That looks ok to me. Take a look at this Oracle document: https://docs.oracle.com/javase/8/doc...gs-switch.html
__________________
Reply With Quote