Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Unable to call getProperty() in inst of Properties

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic