Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to display elements Properties class  RSS feed

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<code>
writeProp = getDataFromCalc(rec);

for(int i=0;i<writeProp.size();i++)
{
System.out.println("Satyajit for Part7Sectionc3====="+writeProp.keys());
}
System.out.println("Satyajit for Part7Sectionc3====="+writeProp.getProperty("Part7SectionC3"));

</code>

Output:
Satyajit for Part7Sectionc3=====java.util.Hashtable$Enumerator@1f541ef
Satyajit for Part7Sectionc3=====java.util.Hashtable$Enumerator@bbef70
Satyajit for Part7Sectionc3=====true


I want to display keys with their correspomding values.
 
Mingwei Jiang
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use propertyNames of Properties class to get all properties names, and iterate every name to get property value.

Reference Java doc of Properties class for help. You will find the answer better than mine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!