Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year. Improve this question How can I create a pool of connections using HttpClient? I have to make freq…
Tag: java
Find all occurrences of a function in Eclipse
In Eclipse, how can I find all usages of a function in a Java app? What is the shortcut for that? I tried with Ctrl+H to search by method, but it return me all methods with the same name. Answer You can find a menu entry in the context menu, when right clicking on the function. You can also press
Using contains on an ArrayList with integer arrays
I have an ArrayList<int[]>, and I add an array to it. Suppose I want to know if j contains an array that has {1,2} in it without using w, since I will be calling it from another class. So, I create a new array with {1,2} in it… …but this would return false even though w was added to the
Java convert Arraylist to float[]
How I can do that? I have an arraylist, with float elements. (Arraylist <Float>) it is not working. cannot cast from Object[] to float[] Answer Loop over it yourself. The nullcheck is mandatory to avoid NullPointerException because a Float (an object) can be null while a float (a primitive) cannot be nu…
Java: can you cast Class into a specific interface?
I’ve got a project I am working on and in this project I would like to include the ability for developers to include their own plugins without having to change the whole code. This is what I have …
How to read PDF files using Java? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, …
httpURLConnection: how long can a post argument be?
I’m currently using something like this: With this I manage to pass some data to my server. What I’m wondering now is how much can be sent this way? I want to be able to send some xml files (100-200 lines long) and would like to know if I can do this? Jason Answer The post body (it’s not usu…
Finding Number of Cores in Java
How can I find the number of cores available to my application from within Java code?
The difference between n++ VS ++n in Java
My Java teacher said it was better to use ++n instead of n++, I am not seeing the logic behind this. Does anyone know? Answer ++n increments the value and returns the new one. n++ increments the value and returns the old one. Thus, n++ requires extra storage, as it has to keep track of the old value so it
Can I change my Windows desktop wallpaper programmatically in Java/Groovy?
Is there a way I can use Java (or Groovy) to change my desktop wallpaper in Windows XP? I have a program that creates a new image every day (or whenever) and I would like a way to automatically update my desktop. I’ve seem some questions on this site about C++ or .NET, but I did not see anything specifi…