Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can you please sort the error??  RSS feed

 
Deepakk Verma
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having error in the program can anybody help please


Error is in 7th line as:
Type mismatch: cannot convert from char to String
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the error indicates, String#charAt returns a char, which you are trying to put in an array, designed for Strings
You need to convert the char to a String. Check out the String API for a convenient method.

PS. Also check out String#substring()
 
Deepakk Verma
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOPS.....i should have taken care of that ............Thanks Maneesh
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!