Using a class to store static data in Java?

前端 未结 7 709
醉梦人生
醉梦人生 2020-12-28 23:50

Is it a bad idea creating a separate class and use it as a storage which consists only of static data variables?

I am currently developing an app for android, but th

7条回答
  •  一生所求
    2020-12-29 00:32

    i suggest that "never" use a global variables ....

    when you are accessing to another activity you can throw some values using Intent.putExtras(Name_parameter, "value_parameter")

    and to recive the value : Bundle b = getIntent().getExtras(); where b has all parameters

    cheers,

提交回复
热议问题