Questions tagged as 'java'

2
answers

Split in Java, how to detect that there is no separator

I am separating a word in Java whose separator is a -, my problem comes in that sometimes it does not have - to separate and therefore it gives me an error, as I could previously detect that the separator does not exist. An example to be underst...
asked by 29.04.2018 / 00:46
5
answers

ListObject to String in Java

I have a List of an Object. public class BusStop { private String description; private float lat; private float lng; //getter and setter } Of which I try to put all its content inside a variable of type String. I tri...
asked by 10.05.2018 / 12:06
1
answer

Problem that I have with inheritance in Java

public class GestionRepartoLocal { // CÓDIGO DE APOYO private ArrayList<Moto> motosDisponibles; private ArrayList<Furgoneta> furgonetasDisponibles; private ArrayList<Pedido> pedidosEsperandoMoto; private A...
asked by 01.05.2018 / 20:40
1
answer

Access, read and write c ++ files [closed]

I was working java and I used Scanner to access the content of text files, and also Printstream to write in new files, what would be the analogous way to perform these actions in c ++? for example, in java: public Class(Scanner sc) { w...
asked by 01.06.2018 / 03:12
1
answer

Error with Random in JAVA

I get this exception, related to Random. Exception in thread "main" java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Random.java:388) at gestorgrupos.Grupo.opcionAleatoria(Grupo.java:78) at ges...
asked by 11.05.2018 / 13:07
1
answer

Join tables with JPA

I request your help because I need to make a union of two tables in a query in order to create a list, but I do not know how to do it, this is the query that you create: SELECT p.id, p.nombre_departamento, p.ciudad_departamento,...
asked by 15.05.2016 / 17:57
1
answer

JSTL appears in HTML

How about! I am doing a small application of Spring (I am learning) and I have found that, when passing as a parameter a List object in sight (JSP), the cycle forEach does not work as it should. Actually if one searches in the HTML the ob...
asked by 02.05.2016 / 16:22
2
answers

Voracious Algorithms

I am a student of programming and I would like to know if any of them can give me an idea of how to perform the following problem using voracious algorithms.    Find a good solution to the following problem using a voracious algorithm. Explai...
asked by 25.04.2016 / 03:25
3
answers

what is the best way to not use many if?

I have a combo that is filled with a list, which has 29 elements, and each element by selecting it in the combo displays more fields, then I have the following conditions, what it does is validate which document you selected and render the input...
asked by 12.01.2018 / 16:46
2
answers

Millennium change date format error

When reading the date of birth of the CURP, and formatting it ( yyyy-MM-dd ), when entering a CURP with date of birth (example: XXXX270503XXXXXXXX ) the formatter instead of putting the date as 1927-05-03 puts it as 2027-...
asked by 03.08.2017 / 00:14