Questions tagged as 'java'

2
answers

Comparator - PriorityQueue

I'm building a comparator for later use within a PriorityQueue. private PriorityQueue<Conta> listaOrdenada = new PriorityQueue<Conta>(new ComparadorConta()); The object I want to sort is the Account. Conta conta = new Conta(S...
asked by 08.11.2016 / 02:30
3
answers

Byte Separation

I am building a system to do communication via Socket: The client system sends the following information: 1 - int - message size 2 - bytes - the message The message consists of: 1 - int - method code that I want to run on the...
asked by 23.02.2016 / 17:07
1
answer

Are methods and constructors the same thing?

Some sources say that constructor is a special type of method, while others say that constructors are not methods. Some people also say that although they are different from the JVM, they treat them the same way. After all, is a constructor a ty...
asked by 19.02.2016 / 19:20
1
answer

I would like to understand the use of a DTO with an Entity

I wonder if my reasoning is correct regarding the use of a DTO Following this logic, am I correct in using a DTO? @Controller @RequestMapping("/") public class CadastroController { private final CadastroRepository cadastroRepository;...
asked by 30.12.2016 / 18:35
3
answers

ArrayList for String with split [closed]

I'm trying to break the following ArrayList with a String : ArrayList<Funcionario> funcionarios = new ArrayList(); But when I instantiate the object, I add the values in there through my method and I try to use split...
asked by 21.11.2015 / 14:35
2
answers

Problem removing element from a linked list

I'm implementing a threaded list in Java. However, the remove function is causing me some problems, but specifically the remove part in the middle of the list. My list consists only of an integer field with a note. public void remove(int nota)...
asked by 20.11.2015 / 03:08
2
answers

Field UF that accepts only 2 uppercase letters

I'm trying to create a specific field for UF, where only 2 uppercase letters will be allowed. I tried using regular expression, but I could not. Could someone help me? public class CampoUF extends TextField { public CampoUF() { te...
asked by 03.11.2017 / 18:51
1
answer

Data sharing between android applications

I created an application that works as a calendar, where you can register contacts with a few more fields in relation to the calendars that are pre-installed on the device. My question is, if it is possible to share the data registered with o...
asked by 28.10.2017 / 17:37
1
answer

Error parameter 5

When I try to change the record already done, it sends the No value specified for parameter 5 . The code: private void alterar() { String sql = "UPDATE tbusuarios SET usuario = ?, telefone = ?, login = ?, senha = ?, perfil =...
asked by 07.02.2017 / 00:13
1
answer

Method invocation may produce NullPointerException

I'm using geocoder to transform the address of the edit text into Longitude and Latitude. I have a problem with the app, but it does not cause any problem in the app, but it gets the error on the screen and I have to press ok every time, and it...
asked by 13.11.2015 / 01:02