Questions tagged as 'java'

3
answers

What is the purpose of putting the final class?

I found a code that was like this. public final class MiClase{ } It's something I had not seen and I do not know if it's any good to put final before class     
asked by 22.01.2017 / 23:54
4
answers

Get the current date with the time 00:00:00 in Java

I have the following code: Calendar.getInstance().getTime(); With that I get the current date, but I want to know if there is any way that the time is 00:00:00 instead of when that method was called.     
asked by 07.12.2016 / 17:33
1
answer

concatenate java arrays [closed]

I have been asked for a two arrays, I have found this tool (int[])ArrayUtils.addAll(a, b) that I can solve in a single line. The problem is that the compiler gives me error    C: \ Users \ BEEO \ Desktop \ java \ practice3> javac Vecto...
asked by 29.06.2018 / 03:05
1
answer

Cognitive complexity in Factory class

I have a question about how to correctly create a factory class without increasing the cognitive complexity. The class consists of a static method that returns an implementation based on a name. Being a large application, there are many implemen...
asked by 08.10.2018 / 14:31
1
answer

What is the next algorithm for?

public void eliminar(int index){ if(index==0){ cabeza=cabeza.obtenerSiguiente(); }else{ int contador=0; Nodo temporal=cabeza; while(contador<index-1){ temporal=temporal.obtnerSiguiente...
asked by 03.03.2017 / 05:32
2
answers

Why do I loop this result?

Scanner entrada=new Scanner(System.in); System.out.println("Introduce un numero!"); String tex=entrada.nextLine(); char[] caracteres=tex.toCharArray(); int[] numeros=new int[caracteres.length]; for (int i=0; i<cara...
asked by 02.02.2018 / 21:46
4
answers

Collect values from EditText

I have a little doubt on Android. Suppose I have an EditText, in which the user will enter a number by keyboard. How can I collect that value? Let's see, I'll do it as if it were a text string, which would be where I do this: private EditText...
asked by 09.03.2018 / 01:07
2
answers

Error printing object in java

I have a Java method that adds movies from a CSV file. Once I get the data from the movie I keep it in an object. The problem that only appears in the Netbeans console: model.Peliculas@7e5df0bd model.Peliculas@30e2c55e model.Peliculas@188d0799...
asked by 11.11.2018 / 17:15
2
answers

Why does not the toString method work for me? Poo Java

Good the problem is that I deposit 100, then remove 50, and when I want to check my balance (calling the method toString) it puts me 0.0, when I would have to say 60, since in the initial balance I put 10 and deposit 100, what could be the error...
asked by 30.10.2018 / 20:29
2
answers

How to compare a String in Java - Java

I would like to know why I can not make it take the next String in the condition if , the only way I did was to go option to char or int and then applying a conversion. Scanner kboar = new Scanner(System.in); Str...
asked by 31.03.2018 / 08:07