Questions tagged as 'java'

1
answer

Sum in TextView

I have a Json that returns the positive and negative values, and set the text in my TextView . This is the calculation I try to do, but it returns an error of invalid double : public double num1,num2,resultado; saldo = (TextView)...
asked by 27.07.2017 / 16:06
2
answers

Doubt about displaying inverted array

Could you explain how it works to return an array with inverted values? I took this exercise to do but I could not. So a colleague gave me this exercise so I could dissect him, but I did not understand anything: S. package pct; import java.uti...
asked by 16.08.2017 / 04:11
1
answer

Check the arrayList object at runtime

I have an arraylist with three positions. I added to the array, objects of the type Manager, Salesman and Technician, respectively. Using getClass , I would like to know how to do which object is in each vector position. I did this, but...
asked by 12.06.2017 / 00:11
1
answer

Calculations skinfolds

Well, I do not know if I can ask for help in relation to the calculation, but anyway, my question is: I need to do the skinfold calculation, in this case the calculation of Pollok 3 folds, I researched the internet, but it is not so easy to u...
asked by 01.08.2017 / 01:47
1
answer

How to change item in an index of an ArrayList?

I'm having trouble with this array exercise:    a) Create the class BlockNotes that has as attribute a    ArrayList<String> called notes. Create methods to insert, remove, and   look for notes Create a method that prints all the...
asked by 26.05.2017 / 02:38
1
answer

Is it correct to throw an exception within a synchronized?

In my app there are some threads that access the database and control this competition using the lock from totalcross. My question is: Can I allow exceptions to be thrown within a synchronized block? or do I have to do something to get the ex...
asked by 25.05.2017 / 15:13
1
answer

Change label color according to screen status

I'm having trouble changing the color of the content of a label, according to the state of my screen (enabled / disabled). I would like to know how I can to make it change the color. I made a very simple example (without worrying about the...
asked by 21.04.2017 / 19:56
1
answer

Read Json in PHP?

I have the following code in my PHP : <?php $url = "https://api.cartolafc.globo.com/mercado/destaques"; $response = file_get_contents($url); $jogadores = json_decode($response,true); It should return the file json ,...
asked by 27.04.2017 / 01:07
1
answer

Separate street address from a string

In my application JAVA , on a screen, I have fields related to the address, I have two ways to register this address, I can automatically pick up the zip code most of the information or put everything "manually" p> The problem is that ma...
asked by 27.04.2017 / 19:03
2
answers

Regular expression to select whole word and case sensitive in accented word

I need to make a program that searches a particular word in a set of texts and labels the searched word in the middle of the text. For this I developed the following method: public void grifarTexto(Relato relato, String texto) { relato...
asked by 15.07.2017 / 21:47