I need to sort a ArrayList in ascending order by date. Because I am adding values out of order in it. In my ArrayList has only two fields in each element: data and valor . Does anyone know of any method I can use?
...
I'm developing a quiz. Using RadioButton as Answer. So far I created using the onClick method on each RadioButton, but it is not effective.
So I would like to call each question ask1(); , ask2(); within the rate(View view)...
I would like to know how to implement a tree where each node can have n children?
As in the example below:
Only in this case would nodes be an instance of a class.
EDITED
I'm trying to do this with a ArrayList , but I'm...
In the following ways, which one is the most efficient?
...
//assumindo que o método pegaListaPessoas() pesquisa na base de dados todos as pessoas
for (Pessoa pAux : pegaListaPessoas())
{
//executo alguma coisa
}
or:
...
//assumindo q...
Hello, I need to get a value after the comma to from it do some operations, for example, 175/10 = 17.5, I need to save this value .5 as 5. My number will always be divided by 10, can you help me please?
I'm getting the following error in my Java code
Exception in thread "Thread-2" java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at Indexador.indexaArquivosDoDiretorio(Indexador.java:42)
at Princ$1$1.run(P...
I'm trying to make a program where salesperson names have to be read and have to be stored in an array.
My biggest problem is that I do not know what the limit of names entered by the user is. So I used the while:
public static void mai...
I was developing a simple java application using Swing, and I'm not sure what the error in my code is.
Here is the code:
private void btnVerificaActionPerformed(java.awt.event.ActionEvent evt) {...
I have the ValueTotal attribute this value should be represented by the sum of all items in the Item class that are in the items list, I am trying to sum all items in the list that are BigDecimal, but when I execute the value is 0, that is,...