Questions tagged as 'java'

1
answer

Does Java accuse wrong memory usage values or is there something wrong with the algorithm?

I was studying GC and the question came up when I rode the below: public class Garbage { public static long carregarMemoria() { List<Integer> list = new ArrayList<>(); for (int i = 0; i < 100000; i++)...
asked by 19.10.2016 / 15:52
1
answer

Is it possible to have Java SE and Java EE on the same machine?

Can I install Java SE and Java EE on the same machine?     
asked by 15.12.2016 / 20:04
1
answer

Is there an alternative to multiple whiles loops?

I have a alterar() method that changes the data of a particular element of my XML Person, however, this routine uses several% s of% s for each element, see below the routine: public void alterar() { try { Do...
asked by 10.09.2016 / 23:25
1
answer

Vector within vector. What does he do in that context?

40 students were asked about the quality of food in the student canteen, on a scale of 0 to 10. (1 meaning awful and 10 mean excellent). Put the forty responses into an entire array and summarize the search results. public static void main...
asked by 29.01.2016 / 20:10
3
answers

Convert object to String?

What is the best way to convert an object to a variable of type int ? Or is there no such conversion? Example: if (teste == JOptionPane.OK_OPTION) { int linha = tblPessoa.getSelectedRow(); // Aqui o ob...
asked by 22.10.2015 / 14:50
2
answers

Empty constructor without super () call

When I make parameterized constructors, I create an empty constructor as well. In the empty constructor, should I always make the super () call? Because? (Take into account, that my class is just a JavaBean.)     
asked by 15.01.2016 / 12:54
2
answers

What is the purpose of the super command when used in the parameter declaration of a method?

In Java the command super has the function of calling the superclass constructor. However, in the declaration of method forEach() of class ArrayList it is used in a different way than usual, see the signature of the method t...
asked by 12.03.2016 / 02:45
1
answer

How to do exponentiation in Java?

I'm trying to do a compound interest exercise and I have this code that follows so far. public class ExDesafio_Aula1 { public static void main(String[]args){ double investimento = 5000.00; double juros = 0.01;...
asked by 23.08.2016 / 22:59
1
answer

What is the difference between variables declared as final and private?

What's the difference between these two types of variables and why they can not be accessed in certain parts of the code? I read about private, public, and abstract methods, but I did not understand the use of the ending.     
asked by 27.10.2014 / 22:12
1
answer

Problem in converting number (NumberFormat)

I'm having the following difficulty, getting a value through my form: Double salario = Double.parseDouble(request.getParameter("salario")); Since the value entered by the user will be something like: 2.687,35 . And this value, I will compa...
asked by 22.04.2014 / 20:07