Questions tagged as 'java'

1
answer

Tie is from index 1 array java

I have a function that makes a for loop in a String array. I need the loop to start from index[1] of that array. But I'm not getting it. String arquivo[] = arquivoDecodificado.split("\r\n|\r|\n"); for(String linha: arquivo ) {...
asked by 12.06.2018 / 15:22
1
answer

change String.xml by java class

Hello, I was wondering if it is possible to modify a String from the values folder by a click of a button. these are String.xml <string name="app_name">FC MANAGER</string> <string name="goleiro_1">1 Diego Alves</string&...
asked by 03.06.2018 / 02:30
2
answers

NullPointerException error in execution

Hello. Again I'm getting NullPointerException error. I can not figure out why. The Activity is as follows:    Create a Java application to control the weekly menu of patients in a Nutrition Clinic. You should consider creating two classes,...
asked by 09.04.2018 / 19:37
1
answer

Insert Json into Json

In a client-server structure (in JAVA), I have the following Json structures separately (example): Structure of Students : {"idAluno":1,"nomeAluno":"Teste da Silva","listaDeTurmas":[1,2]} Structure of Classes : {"idTurma":1,"nomeTurma":...
asked by 12.04.2018 / 16:18
1
answer

How to get objects from a Json Array using JsonArray in java?

I'm having a little difficulty getting information from a Json Array, because it's giving the error:    Exception in thread "main" json.org.JSONException: JSONArray initial value should be a string or collection or array. The output of js...
asked by 12.04.2018 / 15:04
1
answer

Why pass arguments to a Fragment using Bundle instead of a set method

I recently asked myself a seemingly simple question that I could not answer and found no concise answer. The question is simple: Why use Bundle instead of a set method to pass parameters from an Activity to a Fragment? For example: Case 1...
asked by 13.03.2018 / 19:59
1
answer

Problem registering user in list

I'm trying to register users and put them on the list. Initially I just tried to register and test with print. (Even though it indicates errors) Does anyone know why it is not working? The errors are:    can not find symbol in client.setNome...
asked by 20.10.2017 / 18:29
1
answer

How to check if all elements of a vector are between 4 and 4?

I want to compare if all elements of a vector are between -4 and 4, if it is, the algorithm will execute the method. for(int i=0; i< j; i++){ if(vet[i] > -4 && vet[i] <4) calcular(4); }     
asked by 23.11.2017 / 01:46
2
answers

Code with JDBC fails with exception

I'm trying to search the database through java. I'm using this code, but entering the exception: public ArrayList<Pessoas> pesquisar(String nome) { ArrayList<Pessoas> lista = new ArrayList<Pessoas>(); try(Connectio...
asked by 25.11.2017 / 00:51
1
answer

How do I get the value of an input with getParameter?

I can not get the value of the following input. <input type="text" name="rua" class="form-control" id="rua" placeholder="Rua/Av/Estrada" disabled required> This field is populated through a web...
asked by 19.08.2017 / 17:53