Questions tagged as 'java'

2
answers

How do I compare integer lists to know which is the largest?

I have an algorithm to calculate a sequence of numbers (Collatz Conjecture) . The problem is that I need all up to 1,000,000 (one million), from there to know what number creates the longest list, I can not think of good ideas, but even if i...
asked by 12.08.2017 / 22:24
1
answer

Java doubt with equals () and with ==

Until a few years ago if I did in Java    "Hello" == "Hello" gave me as a false result, today I saw a code in which they used it with JDK 10 and out of curiosity I went to check it, and it actually returns true, someone can explain why th...
asked by 08.09.2018 / 20:30
2
answers

different numbers java array

The exercise consists of the following: given two arrays of 5 positions, we fill them with random numbers from 0 to 10 without repeating (until everything is correct) and then in a third array save the numbers from 1 to 10 have not been saved in...
asked by 17.05.2018 / 22:18
2
answers

Return of two values in JAVA

I am working on a decimal to binary converter and vice versa all this must go within the same method the problem is that I do not know how to return the binary value and the decimal one I leave the code waiting for some help package numerosBin...
asked by 24.07.2018 / 01:36
2
answers

Mutable types in Java?

Good morning, I would like to know what the Mutable Types in Java really are, since it is not very clear at times when it comes to teaching. Greetings     
asked by 02.04.2016 / 15:17
2
answers

Time is not updated

I have a class in which I want to get the current time of the pc but it is not updated, it is always the same time, any solution? import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Level; import java.util.l...
asked by 29.03.2018 / 01:36
1
answer

Error starting IndexOutOfBoundsException application

The application starts correctly, the error jumps when I try to access the path where the application is, which in this case is localhost: 8080 The default driver is this package com.example.demo.controllers; import java.util.HashMap; impo...
asked by 20.11.2018 / 09:47
1
answer

Launch program using cmd from Java

I want to launch a program from the execution of my program in java. The command I use in the cmd would be changing user, password and url: "start / B / D" c: \ Program Files (x86) \ Common Files \ Juniper Networks \ Integration "pulselaunche...
asked by 30.10.2017 / 15:28
4
answers

How to format a string to 2 decimal places Java?

I explain: I have a String in Java : String numero = "59.2348837"; this is what I'm trying to do: String.format( "%.2f", numero) And I try to get as a result: String resultado = "59.23"; But it throws me an error becaus...
asked by 18.04.2018 / 00:14
3
answers

How can I show only two decimals in the operation?

I'm working with android studio and I want the answer to only show it to me with only two decimals, I do not know where that is done, only I can be with format () public class MainActivity extends AppCompatActivity implements View....
asked by 05.09.2017 / 22:20