java - How to iterate through nested classes? -


another simple one!

i'm trying iterate through nested classes in android project.

the class structure is:

    public class clsmessage {     public string username = "";     public string password = "";     public string request = "";      public class parameters {         public string name = "";         public string value = "";     } } 

the outer class instantiated "msg". thought i'd query this:

    (clsmessage.parameters params : msg) {     //    stuff     } 

but doesn't work , can't find example on google surprisingly, unless should using iterator in outer class?

i guessing looking following.

public class clsmessage  {     public string username = "";     public string password = "";     public string request = "";      public list<parameters> parameters = new arraylist<parameters>();      public static class parameters {         public string name = "";         public string value = "";     } }  for(clsmessage.parameters param : clsmessage.parameters) {     .... } 

just declaring inner class won't have "inner class" field. need make field it. considering wanted iterate through for-loop, assumed wanted more 1 parameters in message, added list.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -