• Post Reply Bookmark Topic Watch Topic
  • New Topic

deleteCharAt() of StringBuilder

 
Tarun Mohandas
Ranch Hand
Posts: 33
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the guide says you can pass 34.5 to a method taking int, then the guide is wrong.
 
Tarun Mohandas
Ranch Hand
Posts: 33
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!