Questions tagged as 'java'

2
answers

Problem with the while loop in JAva

I try to execute a very simple code, I simply want the program to ask the user to enter their hobbies until the user enters 'done'. Then, the program goes to the next part. The problem appears when I enter 'done' but the loop continues. import...
asked by 17.07.2018 / 18:32
2
answers

What java object to use to insert a date in a PostgreSQL timestamp field

I am working with a PostgreSQL database , in which I have a field of type timestamp since I only want a date with its time (no time zone ). To do the saving I am making use of the object LocalDateTime of Java 8. The ques...
asked by 23.07.2018 / 12:30
3
answers

List or ArrayList in Java?

What is the difference between the following implementations? ArrayList<String> xxx = new ArrayList<>(); List<String> zzz = new ArrayList<>();     
asked by 07.06.2018 / 22:55
1
answer

How to get the value of the attributes of a form with spring?

I have a form, in which I want to retrieve the values entered in the fields, I have the following code in the controller @RequestMapping(value= "/views/consulta", method = RequestMethod.GET) public String redireccionaConsultaPage(Locale locale...
asked by 30.05.2018 / 06:17
2
answers

Put date and time in a variable

I would like to know how you can put together a date and time delivered by a user in a single variable of type Date System.out.println("Ingrese fecha desde la cual se desea programar los pedidos para su producción"); SimpleDateForm...
asked by 13.11.2016 / 00:29
1
answer

Is it possible to access a variable in Java by referencing its name?

I have the following concern for which I am looking for the best solution, if possible in Java. I clarify, that the routine of for includes an error that is just the origin of the concern. I declare constants, for example: Map<Str...
asked by 11.11.2016 / 15:00
4
answers

Program that does not end

I am doing a program, it is asked to enter 3 data, if the 3 are incorrect the program ends, I do a loop do / while and asks for the 3 data the problem is that the program does not finish and passes to analyze the following condition , how do I e...
asked by 07.11.2016 / 18:03
1
answer

Json does not bring all the results

good morning I'm doing an application with Android Studio 3.0.1 with a mysql database and at the time of the query it returns me a json and at the moment of that comes to the app returns me    ["2", "Example2", "Author2", "Editorial2", "F...
asked by 11.04.2018 / 07:37
3
answers

I can not find how to find the biggest

I'm giving it and I can not find how to find the number of students with grades above average. public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n, cont = 0; double acum = 0, p_est, p_gen = 0;...
asked by 04.09.2017 / 20:26
2
answers

How can I move X characters to the right from a String in Java?

The following program reads a txt file line by line: BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(origin),"ISO-8859-1")); String strLine; while ((strLine = br.readLine()) !=...
asked by 19.10.2018 / 14:57