Ukraine flag Armor Games stands with Ukraine Ukraine flag
If you’d like to help, please consider giving to Ukraine Crisis Fund

ForumsProgramming Forum(Not a question) Using strings in Java flow statements

0 4362
1,318 posts

String sampleText = "abcdefghijklmnopqrstuvwxyz"; while(sampleText == "abcdefghijklmnopqrstuvwxyz&quot{}

if u copy-paste this into a java ide and write some commands in the loop, u`ll notice that the commands arent getting executed despite the loop requirement is fulfilled. its because u should use a method called "equals" like this instead of a comparison operator:

String sampleText = "abcdefghijklmnopqrstuvwxyz"; while(sampleText.equals("abcdefghijklmnopqrstuvwxyz&quot){}

  • 0 Replies
Showing 91-90 of 0

We may use cookies to help customize your experience, including performing analytics and serving ads.
Learn More