473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to retreive String object name from value

184 100+
Hi,
How to retreive String Object name from its value in java.?
in the following example
String s1="name";
Thanks in Advance

-Thanks & Regards
Hamsa
Mar 12 '08 #1
3 1218
JosAH
11,448 Expert 8TB
Have a look at the getClass() method and the Class.getName() method.

kind regards,

Jos
Mar 12 '08 #2
gaya3
184 100+
Have a look at the getClass() method and the Class.getName() method.

kind regards,

Jos

yes..Jos.. Class.getName() ll return name of the class.. i ll put you in other way
I'm having one Java Vo class.In that I'm having fields like "FirstName" and "LastName".Also contains set and get() method for those 2 fields..
ok? Till this its clear rite..
Form another Class i'm accessing getlastName() it ll return the "LastName" value rt..
What i need is both the "LastName" Field value and Field name..(i.e ,LastName).
You consider like "Field names are unknown to you" only set() and get() methods are known to you..
you got my point?


-Thanks & Regards,
Hamsa
Mar 12 '08 #3
BigDaddyLH
1,216 Expert 1GB
Why do you want to know or need to know the names of fields in a class? Suppose, as is usually the case, the fields are private. What good is it to know the names of the fields in that case?
Mar 12 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Derek Hart | last post by:
I wish to execute code from a string. The string will have a function name, which will return a string: Dim a as string a = "MyFunctionName(param1, param2)" I have seen a ton of people...
2
by: Ric | last post by:
Please forgive me if i dont explain this situation correctly. i'll try to do my best. because the arraylist.add method only accepts one argument, i created an object with several public...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
0
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
1
by: davemcdonald | last post by:
ASP Javascript (Dreamweaver) insert and retreive Primary Key -------------------------------------------------------------------------------- Been pulling my hair out all week. I am working on...
3
by: questionit | last post by:
We can get a value from a table with this method: abc =10 getResult = DLookup("", "", "='" & abc & "'") What if the resultant values are more than one. How would i retreive those? When age...
11
by: prisesh26 | last post by:
hi, iam passing a name "sun & moon" in my query string as a parameter. but when i receive it through request.getParameter iam getting only sun. rest are getting ignored due to & symbol. how...
0
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi Is there any way to Read an INIFile from a string or Stream instead of a physical file ??? I want to read the INIFile into a string then store in a db but when I read the string from the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.