Java -- Char array to string problem
Go to solution
Solved by Ciccioo,
in java you can't use the == operator to compare objects
what you're actually comparing is not the strings, but the strings references
to do the string comparison you have to use the equals() method
if( s.equals(cs) )
-
Topics
-
xRIXCHx ·
Posted in Troubleshooting0 -
0
-
well91 ·
Posted in Troubleshooting4 -
3
-
PoLygon739 ·
Posted in Graphics Cards2 -
0
-
pchelp ·
Posted in Storage Devices3 -
1
-
MrAuto ·
Posted in Peripherals0 -
KuHakku ·
Posted in New Builds and Planning1
-
-
play_circle_filled
Latest From Linus Tech Tips:
Why Do Youtubers Keep Destroying Companies - WAN Show April 19, 2024
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now