Questions tagged as 'java'

2
answers

Error android.database.sqlite.SQLiteException: no such table: fs_promocoes

public class PromocaoDAO { private static final String DATABASE_NAME = "app_promocoes.db"; private static final int VERSAO_BANCO = 2; private static final String TABLE_PROMOCOES = "fs_promocoes"; public static final String PROMO_ID = "id"; pu...
asked by 09.11.2016 / 18:36
2
answers

Unit test with JUnit for system default routines

I have a Java code that checks if there are any default categories registered in the database, if it returns true , otherwise it returns false . public boolean validaEntradaDeDadosPadrao() { System.out.println("Entrei aqui"...
asked by 01.07.2016 / 21:57
2
answers

Reading String until you find a certain character

I can receive data like:    232321   or   dwd But sometimes a "+" may appear between the Strings. How do I extract only what comes BEFORE this character? If so, I have an entry like this: "432d + 321" I would stay: 432d.     
asked by 18.07.2016 / 18:04
1
answer

Web Crawler (Spider) with ajax in JSF using Node.js or api JSoup in java

I have the task of creating an interface optimized for touch monitor, taking data from a website ( link ). This site gives a listing of bus lines and consults their schedules, using an auto-complete ajax. Because it is a government agency,...
asked by 06.06.2016 / 15:04
2
answers

How to create a method with optional parameters in pure Java? [duplicate]

How do I create a method that does not need to enter all the parameters? Ex. There is a method that asks for 5 parameters. But I intend to use only 2.     
asked by 05.08.2016 / 12:49
2
answers

Remove spaces from an array of String

How do I remove spaces (not all spaces, just the beginning and end) of all the indexes of a String array in Java?     
asked by 21.08.2017 / 20:53
1
answer

In java, a Void that makes a sum, returns value?

My question is what exactly is a return in java. For I think the sum answer would be a kind of return, is that correct? void soma (int a, int b) { int s = a + b; System.out.println (s); }     
asked by 04.10.2017 / 20:31
1
answer

Arrows do not move in text field with regex [closed]

I have the following code with a regular expression inside a Keyreleased method, which allows only a few characters to be entered by the user into a text field: String text = input.getText(); text = text.replaceAll("[^A-Za-z&\|!]",...
asked by 31.10.2017 / 23:57
2
answers

Do While goes into infinite loop

I'm sure my error is in while , but I can not understand what I did wrong. It enters loop infinity. The statement follows:    Implement a program that receives 3 arguments from the command line. O   first and second argument are re...
asked by 30.08.2016 / 01:13
3
answers

Return amount of days to end of year

How could I do to return the amount of days to the end of the year, relying on today. import java.time.LocalDate; import java.time.Month; import java.time.Period; import java.time.format.DateTimeFormatter; public class TestLocalDate { pu...
asked by 28.08.2016 / 21:26