Questions tagged as 'java'

2
answers

Image rotation in java

I need an algorithm to rotate an image in java. On the internet I found a promising algorithm in this link , and I gave a tidy up in it and adapted to use angles in degrees. It looks like this: public static BufferedImage rotateImage(Buffered...
asked by 02.02.2014 / 06:06
4
answers

How to execute .jar with the prompt?

I have already generated the jar file through Netbeans, but I am not able to run the program through the command prompt. What command to run it in the Windows environment?     
asked by 09.02.2014 / 20:03
4
answers

How can I optimize a recursive method to find ancestors?

I have a Pessoa class that has relationships for your parent (these can be null at any time). In a certain part of my code I need to find out if one person is ancestor of the other. I was able to get a recursive solution of the foll...
asked by 13.12.2013 / 14:09
3
answers

java.util.Map, best implementation considering just get (Object key)

I would like to know which class that implements java.util.Map contains get(Object key) faster. The purpose is to make a mini data cache, the volume of information will be approximately 2 to 10 thousand records. Map<Int...
asked by 18.08.2015 / 22:38
4
answers

What is the difference between i ++ and ++ i?

I found a piece of code in an application that I'm giving continuity that I had not seen yet (or had never noticed). I casually always used i++ in a loop of repetition, for example, however in this section it was ++i and I did not...
asked by 04.10.2017 / 08:10
5
answers

What libraries to develop a RESTFul API in JAVA?

I am a beginner in java and would like to create a RESTFUL API but I do not know which library to use or how to use it. Can anyone point me to good tutorials or some libraries to study. I would like to use JSON.     
asked by 13.12.2013 / 12:34
1
answer

How to pick up hardware and system information?

I found only the class Runtime , but it returns only values in numbers, such as total memory and processors. Is there any API that returns hardware data (processor version, RAM, architecture, etc.) as in CCleaner?     
asked by 30.07.2015 / 00:15
3
answers

What is the use of nested blocks in Java?

I saw something written similar to the code below. Does this second block in the method method have any use? Can it be used in any way? I ran this code and it compiled and appeared only the First print. message, not displaying Second pri...
asked by 08.03.2014 / 02:10
4
answers

Working with values that greatly exceed the long (64 bit)

How are operations stored with numbers that exceed the limit values of type long and double ? How are the four primary operations done with these numbers (sum, subtraction, multiplication, and division)?    Context It is co...
asked by 29.02.2016 / 18:49
2
answers

Is this polymorphism?

Is this polymorphism? If so, why? I think it's because there is no method call. Please explain if I am correct or correct me. Thank you :) OutputStream saida = new FileOutputStream("alunos.pdf");     
asked by 26.07.2016 / 05:54