java - am i allowed to use member variables in static inner class for fragments? -


all static fragments are:

public static class somefragment extends fragment {              int somenum;              string name; } 

are values of somenum , name shared between different instances because class static?

are values of somenum , name shared between different instances because class static?

no. if want them shared, declare members static:

public static class inner  {              static int somenum;              static string name; } 

the static modifier on class valid on nested classes, , job there nested class not inner class (a class that's tied instance of containing class). has nothing whether members of class static.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

ios - Change Storyboard View using Seague -

verilog - Systemverilog dynamic casting issues -