Questions tagged as 'java'

3
answers

How to build a differentiable for a Generic class?

How would you build a differentiated constructor for classes that span a generic class? For example, for the situation below, I would like to create a Generic constructor that could accomplish the entity = E.class; statement, but for now I...
asked by 11.06.2014 / 21:38
2
answers

Why compare Enum with an enum object

When I was learning Java, I had a Class that had a Enum property, and at one point I wanted to know if what was coming in a Method was equal to a Enum constant, something like this: public void teste( TipoAlteracaoValor valor ) { i...
asked by 22.05.2014 / 23:04
1
answer

Why unmark main class creation when working with screen?

So far, in all the tutorials I've seen, when we're going to work with a swing screen, we're asked to uncheck the main class creation. I'd like to know the science behind this, and what happens if I do not do it in such a way. Edit: It's in...
asked by 14.11.2017 / 12:18
2
answers

Parsing a timestamp with timezone

I was making a small code to implement a treatment case in a friend application module and got stuck with a problem. This is a unit test. To put in the application module I would have to make some adjustments when inserting into the native co...
asked by 01.05.2018 / 02:36
2
answers

Problem in database connection class

I'm having problems with my MySQL database connection class in Android Studio. Error: 10-16 15:04:02.872 532-532/com.example.dev.mbstore W/dalvikvm﹕ VFY: unable to find class referenced in signature (Ljavax/naming/Reference;) 10-16...
asked by 16.10.2014 / 20:41
2
answers

How to know when two threads have ended in Swing?

I have a method that performs two tasks. I would like two threads to perform each task. Tasks do not share data, they are completely independent. Before starting the tasks, a dialog is displayed with the "Wait, processing ..." i...
asked by 24.10.2014 / 20:21
1
answer

What does Java memory management accomplish in an assignment of a variable already allocated in memory previously?

I would like to better understand what Java memory management performs in the following situation. Knowing that I am suffering from performance problems, I am trying to take the utmost care not to make the situation even worse, it was necessa...
asked by 25.01.2018 / 15:53
1
answer

Erase text in the EditText field

How do I delete text after submission. enviar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String value = editText.getText().toString(); //push creates a...
asked by 19.01.2018 / 14:09
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
3
answers

Recover / locate object in arraylist

I am doing a small CRUD with the theme saving for study purposes. I created 3 classes: Savings, Accounts and Screen (UI Swing). On the screen I register an account with the attributes name, agency, account number (the balance starts with valu...
asked by 13.03.2018 / 10:24