Questions tagged as 'java'

1
answer

Percentage of equality of texts?

Is there a method that lets you know the percentage of equality of two strings in Java? An abstract algorithm would also work.     
asked by 20.10.2014 / 11:20
2
answers

How to justify text in a TextView?

Is it possible to justify (align) the text of a TextView ? Besides justifying, I want to apply other types of formatting.     
asked by 21.04.2015 / 04:42
1
answer

Compensates to migrate from Swing to JavaFX?

Currently most of my applications are made with Swing. I've done 2 small web projects with JSF + Primefaces + Hibernate. My question is this: Is it worthwhile to go out of Swing and study JavaFX, or is it better to study the Web part more a...
asked by 13.05.2015 / 16:40
2
answers

Why does the linear search return for element not found have to be -1?

Why should I return -1 at the end of a linear search if the element was not found? int linearSearch(int[] list, int size, int key){ for(int index=0; index<size; index++) if(list[index]==key) return index;...
asked by 23.11.2017 / 01:54
2
answers

What is the difference of use between mouseClicked and actionPerformed?

What's the difference between these two events: mouseClicked () and actionPerformed ()? What differs in your execution and when will they run?     
asked by 13.06.2017 / 21:16
1
answer

What is the difference between Semaphore and Monitor?

I have a doubt in the concept of these two structures . What would be the difference between them? Which is faster? Which is easier to use? Could you give me a basic example of each?
asked by 31.05.2017 / 00:33
1
answer

CascadeType.ALL does not work. Am I using it wrong?

In my code, I have the Author and Book classes with the Many To One relationship, as below: Author.java import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.F...
asked by 20.12.2016 / 14:03
1
answer

Why String objects are immutable?

Up to the most recent stable version, Java 8, objects of type String are immutable. That is, any change in a String causes the creation of a new object String . Is not this harmful from a performance standpoint? What wa...
asked by 10.11.2016 / 18:28
1
answer

Business object validation avoiding / reducing use of if's and else's

I have a problem where I have three types of employee (EmployeeA, EmployeeB, EmployeeC), all of which will be stored in a table named Employee and their respective relationships, but these types mentioned above have different validations between...
asked by 23.06.2014 / 17:02
1
answer

Java Cryptography with AES, how does it work?

I have already found several examples by Google, but none that explain how a java cryptography works with AES ... How does it work? In an example of the net, the guy cites that he has to use a key, but does not explain why or what it is for;...
asked by 06.05.2014 / 21:44