Questions tagged as 'java'

2
answers

Java only 2 decimal places [duplicated]

I have this code, where I do the sum of a column of a jtable, but I have a problem, I want to limit the number of decimals that come out but I did not get it. Try with the DecimalFormat, but I run it and it does not add anything, it comes out...
asked by 13.08.2018 / 20:17
1
answer

Change Column by Row when typing Excel with Java

I try to change a column to put it as the subject of the rest of the columns, this is the code I have so far, which generates excel. while (res.next()) { Row filaDatos = sheet.createRow(numfilaDatos); for (int...
asked by 29.08.2018 / 19:27
2
answers

How do I do this program? [closed]

Enter a group of 20 people and only count those who are between 18 and 45 years old. The problem is that I do not know how to put the condition of counting ages between 18 and 45. int personas = 21; int edadDe18A45 = 0; int edad...
asked by 28.08.2018 / 19:49
2
answers

Create objects from the elements of an array with the name that they already have JAVA

I have an array and I need to create an object of Element type for each element of the array. I am in the loop with the problem that you can not give an object a variable as a name so I do not know how to create them since the variable Element w...
asked by 16.08.2018 / 08:58
1
answer

AsyncTask Error when changing Activity

When I register a user in the app, an AsyncTask is executed that sends an email to my gmail account, this works correctly but generates an error and causes the new Activity to be loaded once and then loads the new same Activity. This is the e...
asked by 17.08.2018 / 01:50
1
answer

Hibernate + Abstract Classes

Following as regards my doubts about Hibernate is concerned. Let's say I have a database with the table asignatura . CREATE TABLE IF NOT EXISTS 'asignatura' ( 'id' int(11) NOT NULL, 'name' varchar(12) NOT NULL, PRIMARY KEY ('id') )...
asked by 17.08.2018 / 14:10
1
answer

Help / Tips for manipulating dates and formats by reading them with a BufferedReader

I made a program that reads a txt file line by line with a BufferedReader. If the line that reads finds the String "Issue Date", it takes from character 83 to 93 of that line (which would be the actual date) and saves it in a String variable to...
asked by 18.10.2018 / 13:26
2
answers

How can I make sure that when I enter an item in a java fix, first check if it is found?

// Here I have the entry but how could I verify it; Clase []c=new Clase[10]; int i=0; do{ System.out.println("Ingrese numero de cuenta"); c[i]=entrada.readLine(); }while(i<c.length); i +;     
asked by 10.08.2018 / 13:39
1
answer

Null values in hashtable - Java

I am developing a small app in Java, in which I make a connection to a database and I get a JSON field, that JSON I transform it into an object, and later I insert them into a hashtable, and finally I return the hashtable. .. The Subject is i...
asked by 04.08.2018 / 21:09
1
answer

How to format DD / MM / YYYY in a Date type field of a table in oracle?

I have a query which gets some Date type fields The result of this query is downloaded to a .csv file and what it does is that it does NOT show the date fields in DD / MM / YYYY format, try to convert them with to_char but when you sho...
asked by 25.07.2018 / 03:46