Forums Register Login

deleteCharAt() of StringBuilder

+Pie Number of slices to send: Send
I am preparing for OCA from a study guide. In that there is a question:



Which of the following are valid uses of sb variable?

I answered it right but it is given in answers that the following is also a correct usage:



I checked docs.oracle and they have given StringBuilder deleteCharAt(int index)

Based on the above, the deleteCharAt syntax is not correct unless a cast is provided right? How can this be correct syntax?
+Pie Number of slices to send: Send
If the guide says you can pass 34.5 to a method taking int, then the guide is wrong.
+Pie Number of slices to send: Send
Thank you
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1479 times.
Similar Threads
StringBuffer insert()
Problem with Stringbuilder
Unexpected StringBuilder behaviour (slightly OT)
Add & edit ArrayList elements from inside a for loop
How Many Objects?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:24:07.