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

charAt() problem.. plz help..

Vikas Rawat
Greenhorn

Joined: Jan 21, 2005
Posts: 3
i have write this code :

import javax.swing.*;
public class strexample
{
public static void main(String[] args)
{
String s1="hello how r u";
String output;
output += "\nThe String reversed is: ";

for(int count = s1.length()-1;count>=0;count--)
{
output += s1.chatAt(1);
}

JOptionPane.showMessageDialog(null, output, "String Example", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
}


and getting this problem....

---------- Compile Java ----------
strexample.java:15: cannot resolve symbol
symbol : method chatAt (int)
location: class java.lang.String
output += s1.chatAt(1);
^
1 error

plz.. help..
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
You've fatfingered "charAt" to "chatAt".


Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Vikas Rawat
Greenhorn

Joined: Jan 21, 2005
Posts: 3
Originally posted by Jeff Bosch:
You've fatfingered "charAt" to "chatAt".


i dont understand
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
symbol : method chatAt (int)


Your compiler complained that it couldn't find the method "chatAt". The method name is simply misspelled. If you correct your source code to invoke the "charAt" method, it will work. There is no "chatAt" method. (Note the 't' in the fourth character of your method name.)

Hope this helps...
Vikas Rawat
Greenhorn

Joined: Jan 21, 2005
Posts: 3
ohh.. yes...

thanks for helping me...
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: charAt() problem.. plz help..