You need to sign in to do that
Don't have an account?
Saurabh Kulkarni 26
Accessing Inner class variables
Hello all,
I have a class structure like below:
I'm Using this class to deserelize JSON. Once I deserelize I'm getting all the details in MainClass instance.
For eg:
JSONPareser jp = (JSONPareser) JSON.deserelize(JSONString,JSONParser.class);
jp object contains value of all the variables.
Now, I want to access value of x and y variables. How could I do that??
I'm only able to access jp.a and jp.b ..... What can be done to access x and y..
Thanks in advance
Saurabh
I have a class structure like below:
Public void MainClass { Public String a; Public Strnig b; Public void SubClass{ Public String x; Public String y; } }
I'm Using this class to deserelize JSON. Once I deserelize I'm getting all the details in MainClass instance.
For eg:
JSONPareser jp = (JSONPareser) JSON.deserelize(JSONString,JSONParser.class);
jp object contains value of all the variables.
Now, I want to access value of x and y variables. How could I do that??
I'm only able to access jp.a and jp.b ..... What can be done to access x and y..
Thanks in advance
Saurabh
Hi Saurabh,
Yes, we can acces through reference variable, otherwise we can't passible to access that variables. mean there is no otherway.
Thanks
Thulasi