writing java code return the next character of string which the user input it
ex : the input = tee
the output = uff
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Well, are you going to wrap from z to a and what about caps vs lower case?
yes from z to a ..their is no problem if it lower case or upper case
I am not sure what you mean by "their is no problem if it lower case or upper case" because to a computer they are completely different things.
In Java, a char is basically an unsigned short. If you add one to it, it becomes the next letter. However, if you are on z or Z, it will become something that is not what you want. In those cases, you can just change it to a or A as needed with an if statement.
Now, if you need it to be able to account for other things than just adding one, then it takes a bit more work.
Not the answer you are looking for? Search for more explanations.
Also, with youe example you will want to itterate the string. That means findinf the string length and then walking through it one character at a time. You can use string.length() and string.charAt() with a loop to do this.