I'm having trouble extracting repeated numbers from a ArrayList , here's the snippet of code:
for( int i = 0 ; i < houses.size(); i++ ) {
for( int j = 1; j < houses.size(); j++ ) {
if(houses.get(i).equals(houses.get(j...
I would like to add the number of lines to linhaPreta with only 0, and the linhaBranca with only 1.
public class Pixel {
public static void main(String[] args) {
int[][] img = {
{ 1, 1, 1, 1, 1, 1, 1, 1 },...
In Java swing, a user can select more than one radio button simultaneously, so that it does not happen, one can do:
private void radio1ActionPerformed(java.awt.event.ActionEvent evt) {
if (radio1.isSeleced()) {
radio2.isSelected(fa...
I'm not aware of this keyword, I've never seen an example code used. Until I discovered her existence today when reading some books on Java, however it was not clear what the utility. What is strictfp ? What is it for? When to use?
You can treat x like *, because the user will type x to multiply in a number, would you like the program to recognize x as a multiplication via code?
example double b = 5 x 5;
In a test code (in Java), the purpose of which was to convert a string to another string by intersecting the letters between uppercase and lowercase letters, I received the error a follow at compile time:
error: char can not be derefer...
Can I have multiple JDK / JRE installations? because I have two different softwares being one that depends exclusively on the 32bit version (aptana studio 3) and I am already using the 64bit version in eclipse.
I'm practicing some new things that came with Java 8 and among those using Stream. I have heard in a place that when we do some action in a list using the stream, it does not change the value of the original list, for example:
List<String&g...
I'm trying to make the difference in hours in my application. The case is as follows: Based on the current current time and current minute , I want to compare another time I have in a string and I need to know how many hours and how many minute...