• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to access the field value of Object by using string constant  RSS feed

 
deepan thiagu
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai every one

assume "FieldClass" class have int variable 'z' meant i need to access the field value by using sting constant "z"
i try following ways

i cant access the field value
i can access "java.lang.reflect.Field" object,
i dont know how to access the field value from "java.lang.reflect.Field" object,

By
thiagu.m
 
Kuba Zygmunt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have an object Field f then call a method get(Object from which you want to get the value) ( or getInt or other..).




[ August 21, 2007: Message edited by: Kuba Zygmunt ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!