Questions tagged as 'java'

1
answer

PSQLException: syntax error on or near "user"

I have this error when using PreparedStatements to insert a User into a table in Postgresql called " user ", this action is carried out by crushing a button with the help of a PostgresHelper: PostgresHelper client = new Pos...
asked by 17.10.2018 / 17:25
1
answer

Why does the operator cause problems when comparing two conditions in a do while in java?

For example: import java.util.Scanner; public class PruebaDeMetodos { static Scanner teclado ; public static void main(String[] args) { System.out.println("Escoje las opciones 'a' 'b' 'c':"); boolean anulado=false;...
asked by 14.07.2017 / 01:41
2
answers

How to open files with FileInputStream?

I have a problem, I am programming an app to encrypt files and I get the following error:    java.lang.RuntimeException: java.io.FileNotFoundException:   /tmp/File.txt: open failed: ENOENT (No such file or directory) This is my code: pu...
asked by 16.07.2017 / 06:16
1
answer

Delay sending SMS

I would like to know how I do to delay 20 seconds in sending the next SMS. I want several to be sent with a difference of 20 seconds each. This is my code: import android.app.Activity; import android.content.Intent; import android.content.p...
asked by 04.07.2017 / 15:46
1
answer

How to read a JSON from a URL

I have to read this Json: JSON in question For this I have the following code and yet I do not see the error. Can someone help? To be able, I would like to do it with the Gson google libraries public class JsonUrlReader { pub...
asked by 13.07.2017 / 22:08
1
answer

Perform web app with angular and java [closed]

Good friends, that's my question, is it possible to make a web application using java backend? I have read that they use angular with php and / or webservices, but nevertheless I have not seen much info about java, is it possible to bring data t...
asked by 05.07.2017 / 23:44
1
answer

Disorder words from a txt

I have a program made in JAVA that shows in console a txt file that contains a list of words sorted alphabetically: try{ FileReader fr = new FileReader("archivo.txt"); BufferedReader br = new BufferedReader(fr); String [] file = {"arch...
asked by 06.06.2017 / 06:44
2
answers

Passing a string to an object

I need your help, I have a chain like the following String texto= "[{abc-123,mazda,caba,2016,s,26000}; {xyz-215,nissan,almera,2014,a,18000};{efg-901,mazda,2,2012,m,17000}]"; I need this chain to separate and add all to a ArrayList of...
asked by 21.06.2017 / 04:39
2
answers

Read XML file

I have the following program: package exercici3; import java.util.ArrayList; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * @author Montse */ @...
asked by 28.09.2017 / 10:39
1
answer

How to use the TimeUnit class in Java?

I have the following exercise that asks me to create a method that given a number of seconds, the program expresses it in Days, Hours, Minutes and Seconds. I found this code in StackOverflow: int day = (int)TimeUnit.SECONDS.toDays(seconds);...
asked by 19.06.2017 / 02:15