Questions tagged as 'java'

1
answer

Double.valueOf (String) .doubleValue () [duplicate]

As I could not convert a String to Double because it is decimal, I used Double.valueOf (String) .doubleValue (). But when converting a String to Double with "." the numbers above 3 boxes (1,000) are not stored in variable Double even with the...
asked by 10.06.2018 / 20:05
1
answer

Read latest email - JavaMail

I have searched around here, but without success. Does anyone know how to fetch the most recent email using JavaMail ? What I'm using pulls all emails. My code: try { campolog.setContentType("text/html");...
asked by 10.07.2018 / 03:24
1
answer

Send a message to WhatsAPP via system [closed]

I was reading about WhatsApp in StackOverflow, but by the method you've described in previous questions, it does not seem to be working. Does anyone know of any method to send message to WhatsApp, via php or java?     
asked by 23.05.2016 / 17:31
3
answers

Generate random number between two numbers with Math.random [duplicate]

I need to generate a random number between 1000 and 9999 , I found the following formula: (int) (min + Math.random() * (max+1)) Code: int numeroAleatorio = (int) (1000 + Math.Random() * 10000); System.out.println("Thread A: " + numer...
asked by 22.10.2016 / 22:01
1
answer

Hibernate with Java 9

I have a personal project using Hibernate with java 9, and it seems to me that it does not work at all! Here is the error: log4j:WARN No appenders could be found for logger (org.jboss.logging). log4j:WARN Please initialize the log4j system pro...
asked by 04.12.2017 / 12:15
3
answers

Check two negations on an if expression

I'm putting this in: if(!teste.trim().equals("") || (!(teste == null))){ // ...faz algo sem NullPointerException... } But the second clause is not working, which tests if it is not null . I do not know what I'm doing. Later...
asked by 17.08.2016 / 12:37
2
answers

Filter common elements in two Arrays

How do I get a third arrangement with the intersection (common elements between the two arrangements) between two non-repeating arrays? int [] a = {1,2,3,4,5,6,7}; // arranjo 1 int [] b = {0,1,2,3}; // arranjo 2 int [] c = {1,2,3}...
asked by 15.11.2018 / 00:39
1
answer

How to compare numbers in vector list?

I have an integer vector list in java (ArrayList ListVet). public static ArrayList<Integer> ListVet; And I need to make a comparison between two numbers in that same vector list. So I did like this: for (int i=0; i<ListVet.size()...
asked by 20.11.2018 / 04:49
1
answer

ArrayList returning null values

I have an array, I add values in this array, I send them to a method in another class that puts the values of this array in a string only and I add this single string in an ArrayList, but when I go to show it, it shows only several nulls ". M...
asked by 20.04.2014 / 18:32
1
answer

How to leave a persistent CRUD? [closed]

I made a simple CRUD, and wanted to leave his data saved, so when I open Netbeans is all information saved.     
asked by 19.04.2014 / 22:25