Questions tagged as 'java'

1
answer

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toString ()' on a null object reference

I'm having trouble on line 141, where it says the string is null and points me to the error in this line JSONObject jsonObject = new JSONObject(response.body().toString()); But I am not able to solve, below the code along with logc...
asked by 12.04.2018 / 16:35
1
answer

Delete database information

public void excluir (int codigo){ String[] parametros = new String[1]; parametros[0] = String.valueOf(codigo); conexao.delete("CLIENTE", "CODIGO = ? ", parametros);} This is the method to delete a data from my table This is th...
asked by 02.04.2018 / 03:47
1
answer

Display a string in a text field that is locked for editing

I developed a client-server chat and I'm adding some functions to make it more presentable and complete. One thing I still do not know how to do is display a string inside a text field. As soon as I run the program, I ask the user to enter hi...
asked by 16.09.2018 / 22:22
1
answer

Why is it mandatory to initialize a final variable when an instance is built? [duplicate]

In a review for certification, I came across the following code: public class Initializer { static int si = 10; int i; final boolean bool; } It generates compilation error in the declaration of variable final boolean bool...
asked by 11.04.2017 / 05:01
1
answer

Separate listings of one object for each object of the type of another class [closed]

Good Night. My question is regarding the algorithm of my project, I am trying to make an application where each Client can make several requests but each request belongs to a different Client. I still remember that one-to-many logic and aggregat...
asked by 06.04.2017 / 02:54
1
answer

call a screen with only buttons and methods

I need to create a screen that calls another one, but I want to do this using only methods, and in the code I made, it is not calling the other one. On the first screen I have a list and a include button. When you click on the include button,...
asked by 10.05.2017 / 02:27
1
answer

Compiling a webservice

I created a WebService in eclipse using java, but how do I compile this WebService and put it to work without the need to install Eclipse? Note: I've used tomcat as a server     
asked by 08.05.2017 / 19:33
1
answer

Voice command that triggers a button in the Android application

I'm a beginner on Android and made a framework for speech to text, I'd like to know how to trigger a button within the application using this function.     
asked by 17.05.2017 / 02:36
1
answer

Hash function in java [closed]

Could anyone show me (and explain) a hash function (scatter function) other than the one of division? (key% size)? I wish it was a simple (and there is). In case I have a table of 11 positions that should calclar from the number of the cpf its i...
asked by 12.06.2017 / 03:03
1
answer

How to save a record in PostgreSQL?

This error occurs when I try to save a record in the PostgreSQL database, I'm using java mai 15, 2018 11:09:18 AM bibliotecapesca.CadastroLeitor BtnSalvarActionPerformed GRAVE: null org.postgresql.util.PSQLException: ResultSet não está posicio...
asked by 15.05.2018 / 16:13