Questions tagged as 'java'

1
answer

What is the best way to work with queues in java?

In what scenarios is a queue necessary? What is the advantage of using this algorithm?     
asked by 09.11.2017 / 15:11
1
answer

How to insert via SQLite a data in its respective Acitivity

I'm doing an android application and inside it has a fixed listiView sent by an array of string for example String[] servicos = {"Eletricista", "Pedreiro", "Pintor", "Encanador", "Arquiteto", "Engenheiro", "Marcineiro", "Serralheiro"};...
asked by 14.11.2017 / 21:46
1
answer

Vector search - ArrayIndexOutOfBoundsException

I'm building a function that does a linear search in an array. What I would like is that instead of leaving the value of the array size in the call, I would like to use the length property so that it can even calculate its size and thus m...
asked by 28.08.2017 / 01:18
1
answer

List files from a specific folder

I have the following code: public static final String PATH ="/Conceitos"; public static List<String> loadFilesName() throws IOException{ List<String> strings = new ArrayList<>(0); File root = android.os.E...
asked by 30.03.2017 / 20:14
1
answer

Overloaded builders: Instance initializer

From the point of view of compiler behavior and java class design what would be the justification for using the Instance Launcher block? Considering the following class: class Caneta { public Caneta() { System.out.println("Canet...
asked by 31.03.2017 / 04:02
1
answer

Treat empty field even containing spaces

I made a temperature converter from Celsius to Fahrenheit, I'm trying to treat if the JTextField is different from 0, display the temperature in fahrenheit, but 0.0 appears until empty, with spaces inserted in that field. @Override...
asked by 19.02.2017 / 22:06
1
answer

Pass variable between windows javaFX

I am passing a variable from window "A" to window "B". So far so good. The problem starts when in window "B" I try to access the variable when the window starts. Past value does not exist. Ex. My code. Window "A" FXMLLoader loader = new FXM...
asked by 08.02.2017 / 17:38
1
answer

Division by zero in double = result Infinity

I was learning about handling errors in the Java language and I tested the example code of the class in question. In a test I added (double) to the final operation to leave the result more accurate and I noticed that after that, when I tr...
asked by 17.02.2017 / 19:16
1
answer

How do I display the FloatingActionButton button?

Could you help me? I'm trying to make the FloatingActionButton button appear on my screen but it does not want to appear I do not know what else I'm doing ... I'm trying to solve this problem a long time but I can not solve: <?xml version="1...
asked by 01.02.2017 / 20:29
1
answer

Function Delete from the list

I have this function to delete from the list chained by value: public void deletar(Object valor) { Node temp = head; while(temp != null) { if(temp.getNext().getValor().equals(valor)) { temp.setNext...
asked by 08.02.2017 / 01:59