aspose file tools*
The moose likes Beginning Java and the fly likes deleteCharAt() of StringBuilder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "deleteCharAt() of StringBuilder" Watch "deleteCharAt() of StringBuilder" New topic
Author

deleteCharAt() of StringBuilder

Tarun Mohandas
Ranch Hand

Joined: Feb 12, 2013
Posts: 33

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?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

If the guide says you can pass 34.5 to a method taking int, then the guide is wrong.
Tarun Mohandas
Ranch Hand

Joined: Feb 12, 2013
Posts: 33

Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deleteCharAt() of StringBuilder
 
Similar Threads
StringBuffer insert()
How Many Objects?
Unexpected StringBuilder behaviour (slightly OT)
Add & edit ArrayList elements from inside a for loop
Problem with Stringbuilder