• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to call getProperty() in inst of Properties  RSS feed

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this message on compile:

TokenCount.java:68: cannot resolve symbol
symbol : method getProperty (java.lang.String)
location: class java146.util.PropertiesManager
= new PrintWriter(new BufferedWriter(new FileWriter(props.getProperty("tokencountfile"))));
^
1 error
(carat under dot between props & getProperty)

I passed PropertiesManager() into TokenCount which is an instance of Properties().

The TokenCount file is as follows:



The PropertiesManager is:



I don't understand why it can't resolve this.
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aaron,

It should be:


I suggest you change the variable name for either PropertiesManager or Properties to avoid confusion. Better still, keep all the instance variables of PropertiesManager private.


Joyce
[ September 27, 2004: Message edited by: Joyce Lee ]
 
Aaron Parker
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much! I can't believe how simple some of these problems seem after you have the answer!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!