DEV Community

Discussion on: Can you use == for strings in java?

zoedreams profile image

the == in java is mostly used to compare object types with reflection etc.. however you can use it compare literal string under the hood it uses string compare library, so its much faster to implement that directly.