Questions tagged as 'java'

2
answers

Regular expression

I have a question about how can I make a regular expression to remove phone masks, cpf, cnpj. I was able to remove ("-") from the CEP String[] cepText = edtCep.getText().toString().split("-"); ai in the case of phone has ()#####-####...
asked by 20.12.2016 / 12:07
2
answers

How do I display what's inside the list?

I have this method that adds things to the list: public Pedido adicionarPedido(int quantidade, String nome){ lista.add(new Item(quantidade, nome )); return this; } And instantiated in this class the attributes in the...
asked by 16.11.2016 / 14:02
2
answers

How to use vectors / arrays in Java?

Hello, I am very lay in Java and I need to use one variable storing several others. How can I do this? I have the following: LatLng ponto1 = new LatLng(-19.924312,-43.931762); LatLng ponto2 = new LatLng(-18.851388,-41.946910); I'm used to C...
asked by 08.10.2016 / 04:24
1
answer

How to redeem an Actor variable in Libgdx?

I have the following Actor: public class Carta extends Actor { Sprite sprite; public static int val, pos, peso; Texture texture; public Carta(int valor, int posicao) { val = valor; pos = posicao; switch (val) { case 1:...
asked by 20.06.2016 / 16:37
3
answers

Multidimensional array of different types

I have a view in the bank of my application where I count the user's name, his sector and the total number of records issued (tale from another table):    TotalPorUsuario (View) Table       Columns: name (string), sector (String), total (i...
asked by 15.03.2016 / 15:20
3
answers

Doubt about IP display of the local network

I'm developing an application to turn off PCs in a lab. I have a reference to class InetAddress , invoking method getLocalhost() . Then I set this to a% byte of% and then I made a array to display the IP in sequence. Howeve...
asked by 17.11.2014 / 13:45
3
answers

Applying interface in Controllers

I have some controllers that call their respective models and would like to interface on them. I created an interface with some methods that would be important for everyone to implement, as follows: public interface IController<E> {...
asked by 23.03.2016 / 13:25
1
answer

Generate random 10-character alphanumeric code

I currently have an application that is displaying data divergence because of the return time of a webservice. To get around this we have created a code to prevent this information from ever being repeated until everything is working. I ne...
asked by 28.10.2014 / 14:39
3
answers

Find the element with the largest number

I am making a basic election system, but I have a problem in telling which candidate was elected. In the case, I added three candidates (x, y, z) in ArrayList , put two votes in the x, three in the y and four in the z. When I want to know...
asked by 03.06.2017 / 02:33
2
answers

Problem inserting data into a vector

I have the classes Port, Building and main: public class Porta { boolean aberta; String cor; double dimensaoX, dimensaoY, dimensaoZ; void abre() { this.aberta = true; } void fecha() { this.aberta = false; } void pinta(String cor) {...
asked by 24.05.2015 / 03:47