Questions tagged as 'java'

1
answer

Java method show dates in a loop

Good evening, I have a method where I get the amount of installments and the starting date. I want to add 1 month to this initial looping date and I'm confused, giving quite a different value: public void faturar(int parcela, String dataFatura...
asked by 20.09.2016 / 00:16
1
answer

Refresh page re-inserts

I'm starting web development with java and I'm doing some testing and I came across the following situation, I created a form that loads a list based on every click of the button, however, when I refresh the page I still load the list with the l...
asked by 26.08.2016 / 18:56
1
answer

Android - Detect specific word in an EditText

How do I when a button is pressed, activate a function only if a specific word has been typed in any position in an EditText? Thank you. main.xml: <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android...
asked by 16.05.2018 / 18:35
2
answers

Reading rows from a TXT to ArrayList

I need to read a log recorded in a TXT file that contains geographic coordinates in the following form: -54.123440,-21.123456 -54.123425,-21.123467 -54.123435,-21.123480 -54.123444,-21.123444 -54.123452,-21.123100 Each line has the longitud...
asked by 18.05.2018 / 21:23
1
answer

What comes after OOP? [closed]

I'm finishing the course of OOP in Java and would like to take a doubt. So far I was not given anything as to how I could put a desktop development for third-party use. For example, on websites you need a hosting platform (right?), And how do...
asked by 22.05.2018 / 18:47
1
answer

Go through HashMap with equal values

I'm developing an application in Java Web, where it contains several CRUD's. I need to perform some validations of values that I have stored in a HashMap. How do I go through it and check if the values are the same? public Boolean validaProjet...
asked by 21.05.2018 / 14:05
1
answer

Problem generating random value using Random class

The program is generating a random value, but sometimes it pops the array, or simply does not display anything. Error examples: Mycode:importjava.util.Scanner;importjava.util.Random;publicclassSorteio{publicstaticvoidmain(String[]args){S...
asked by 13.09.2017 / 20:51
1
answer

Put the first letter of each word in uppercase

I want to standardize what the user typed in edittext, placing the first letter of each word in upper case and the rest of the letter lower case. How do I do this? The part that directs the variables in the model class Contato c = new Conta...
asked by 15.09.2017 / 00:49
2
answers

Error "java.lang.OutOfMemoryError" with List

I have the following problem statement:    A method that takes an integer as a parameter and returns a list of integers with their decomposed prime factors. As an example, if the entry is number 36, the method returns a list containing [2, 2,...
asked by 03.09.2017 / 03:24
2
answers

Doubts about how to iterate over an ArrayList

I have this exercise below to do in the question "D" I am having difficulties, if someone can explain to me how I should do:    a) Create an interface called ModeloContato with methods getNome() , getTelefone() and ge...
asked by 20.08.2017 / 19:30