Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ArrayList compile time error - cannot resolve symbol

 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiya.
This is a follow on question from the previous question
http://www.coderanch.com/t/395661/java/java/NullPointerException-when-String
I'm getting the compile time error

cannot resolve symbol
method add (java.lang.STring, java.lang.String)
interface java.util.List;
.....txRecord.add(lst_acctName[var_counter],

when I try to compile following code. I cannot see what javac if faulting.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the error message says, the List interface doesn't have any "add" method that takes two Strings as arguments. What are you expecting this method you've invented to do?
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Thanks for replying.
I intend it to store 1,2, or more records with a given record structure.
During runtime, other applets will be querying var_counter, update it eg. var_counter+=1; assign new values to the runtime variables which are then assigned to the record. It doesn't matter that it is transient, at the end it will be flushed to a database.
The size of the array is interminate at the beginning.
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, saw the error, compiles okay like this but pretty convoluted:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic