Questions tagged as 'java'

2
answers

Configure IP for server access using Hibernate

I have a Java application that uses Hibernate, for development I did the configuration of the database using the localhost however for use on other computers I will need to define the IP that will own the database (Server) in my project I use th...
asked by 02.06.2015 / 16:15
2
answers

Converting Int to String!

I'm trying to retrieve some information stored in the database, but when it's done an error occurs, since I'm trying to get an "integer" value and pass it to "String", there I can not do this conversion, codes: public class ProdutoAdapter exte...
asked by 04.12.2018 / 00:38
2
answers

Remove item from a collection

Why is it incorrect to remove an object from a collection in this way? And why the release of the ConcurrentModificationException exception? for(String item: list) { list.remove(item); }     
asked by 06.11.2018 / 19:36
2
answers

Difference between the 2 expressions?

int p=4,u=12; System.out.println(p=u); System.out.println(p=+u); I do not understand, what is the difference between the two expressions?     
asked by 16.01.2018 / 15:45
2
answers

How to modify the last item in a string in Java?

People, I do not know if this is the question for doubt I have, but come on ... I want to get the following output: "V V V V V!". First I created a simple algorithm just to simulate the output, no exclamation point at the end of the output :...
asked by 07.07.2018 / 07:42
1
answer

How to create variable dynamically?

I would like to create a variable for each iteration of a for. Example: for(u=0;u<tamanho;u++) { int variavel[u] = "valor" } Is it possible? UPDATE This is the actual code. SearchConstraint c1 = factory.createConstraint("meta...
asked by 05.10.2015 / 20:55
2
answers

Convert String to Date

I'm new to java and am having a question about converting String to Date. I've spent hours researching the internet to see if I could find any solution and I came across very few solutions but when I was going to put these solutions to run, my a...
asked by 16.10.2015 / 16:54
2
answers

Array lookup within another array in Java

I need to compare two two-dimensional arrays ( int[][] ) of different sizes, the two being formed by integer values (1 or 0), to check if there is the smaller array inside the larger array. Larger array example: Smallestmatrixexample:...
asked by 20.10.2015 / 03:13
1
answer

lista.clear () vs list = new ArrayListT () [duplicate]

To remove all items from a list, I can do it in two ways: lista.clear() and lista = new ArrayList<T>() . What are the differences between them? In which situations should I use each?     
asked by 27.03.2017 / 21:43
2
answers

"java.lang.NullPointerException" error in Java

Good afternoon, I have an error on line 17 of main. I have one "Student" object and another "POO1" object. I wrote the following code: Aluno aluno = new Aluno (); Avaliacao poo1 = aluno.getAvaliacao(); To send the notes I wrote this:     //...
asked by 20.03.2017 / 18:54