Questions tagged as 'static'

2
answers

Warning: (40, 5) Do not place Android context classes in static fields; this is a memory leak

I'm running into this warning from Android Studio. Warning: (40, 5) Do not place Android context classes in static fields; this is a memory leak (and also Instant Run breaks) I have a button that opens a DatePicker fragment to select the date....
asked by 24.10.2017 / 21:12
1
answer

Static properties and memory release

I have some doubts regarding the release of resources for cases where my modifiers are static. My project is unit testing and I'm using Selenium for the first time. public class LoginTest : Base { [ClassInitialize] public st...
asked by 19.05.2017 / 16:46
1
answer

static does not share values between web users

Can I use a static property without sharing values between different users? More or less like Session ? Ex: scenario: private static double valorRetorno; public CalculaValor() { valorRetorno = //recupera valor do cliente } pub...
asked by 26.08.2015 / 20:33
1
answer

Static Members String

I'm trying to create a static member in a class so I do not need to instantiate the class to get the value of the class. In the examples I found on the internet, it references members int . In my case I want the static member to be a...
asked by 22.10.2015 / 23:00
1
answer

Page cache is not expiring

I'm using caches_page in a controller in my rails 4 application. caches_page :index, expires_in: 10.minutes I need to make this controller run again after 10 minutes and generate a new page. When I squeeze this in the production environment...
asked by 25.06.2016 / 02:10
0
answers

External static methods not being recognized in the project

I'm importing a utility library into my main project, the library currently contains a single static method, I can import both manually and maven, but I'm not able to access the static library method. I'm using Spring boot, maven and JDK 1.8 in...
asked by 26.11.2018 / 13:02
0
answers

PHP Methods static [duplicate]

PHP allows me to have static methods. The advantage is that you have them accessible without having to instantiate the class Documentation . However, when it comes to static methods, I can use them both ways WITHIN YOUR CLAS...
asked by 16.04.2018 / 20:06
2
answers

Instantiate class with static method

namespace Classes { class Program { static void Main(string[] args) { Editora ed = new Editora(); Program p = new Program(); ed = p.EntradaDeDados(); ed.InserirProvedorSql...
asked by 11.03.2018 / 07:02
1
answer

Calling a static method by name as string in JavaScript

If I want to call a static function by name as string, how do I? I did what is below, suppose the function name is "move". class Transformation { static operate(object, function_name) { eval(function_name)(object); } s...
asked by 25.07.2018 / 01:40
2
answers

Does this code cause any memory problems?

Follow the original code: class Table{ private static $table; public static function draw( stdData $data ){ self::$table = new self; return self::$table->_draw( $data ); } ... I made this modification bel...
asked by 30.11.2015 / 21:09