• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

charAt used on arraylist

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to get characters from or actually just single letters from an arraylist. Am I able to use charAt on an array list, I'm getting an error when I try it: cannot find symbol on lines 73, 75, 77, 79. Should I use substring instead?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The JavaDoc would be good here... the java.util.ArrayList class doesn't have a charAt() or a substring() method.

Henry

Dustin Schreader wrote:I'm trying to get characters from or actually just single letters from an arraylist. Am I able to use charAt on an array list, I'm getting an error when I try it: cannot find symbol on lines 73, 75, 77, 79. Should I use substring instead?

 
Ranch Hand
Posts: 198
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
charAt() and subString() are the operation those belongs to String, these can't applied on Arraylist. These methods make no sense with ArrayList.
fetch the string from the Arraylist and then you can apply these methods.
 
reply
    Bookmark Topic Watch Topic
  • New Topic