Questions tagged as 'java'

1
answer

What is the difference between @PostConstruct and the constructor?

What's different about using the @PostConstruct annotation instead of using constructor method and its advantages? I ask based on these two versions of the same class that only differ by this annotation. Before @Repository public class Old...
asked by 14.04.2015 / 19:41
2
answers

What kind of data (double, float) should I use when representing a temperature?

My question is regarding the use of Double and Float in Java exercises when having to declare a temperature (Celsius scale). Which one should I use in this case? I declare as Double , but the teacher correcting the exercis...
asked by 07.09.2018 / 21:00
1
answer

How to run a suite of suites in JUnit?

I have the following suites below: @RunWith(Suite.class) // this other matters @Suite.SuiteClasses({ TestC.class, TestB.class, TestA.class }) public class MySuiteA {} @RunWith(Suite.class) // this other matters @Suite....
asked by 31.01.2014 / 21:04
2
answers

Build build in the Maven project

I would like to generate a Java build using Maven, where the generated .jar file name was the same as the last revision number of the SVN repository.    Example: My last generated build has the following numbering:   1.0.0.51. And during the...
asked by 22.01.2014 / 21:08
2
answers

How to do an "equivalence" of IO in Java and C ++?

I made the following code in C ++: #include <iostream> template <typename type> class Foo { public: Foo(type FooTest) { std::cout << "Foo " << FooTest; } }; int main { new Foo<double>(...
asked by 01.03.2014 / 03:25
1
answer

Spring Security, display message when you log out

I am controlling the session of my application with Spring Security, I have two rules to terminate the session, max-session <session-management> <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" ex...
asked by 13.08.2015 / 21:41
1
answer

Database Mirroring

I'm developing an application on Java using database PostgreSQL , locally. Well I would like to know if there is a way to mirror this my local bank to an external server? Is there any API in Java for this? If you can he...
asked by 30.07.2015 / 03:29
1
answer

Location of specific points on maps

Hello, I'm developing an application that works with the JXMapViewer library in the java language, one of the proposals is to find geolocation points (eg, stops / snack bars) in a certain street that the user selects. Location geolocation info...
asked by 01.07.2015 / 01:15
1
answer

How to pass a number in scientific notation in Java?

I'm using a method to not display scientific notation DecimalFormat dfor = new DecimalFormat("#"); dfor.setMaximumFractionDigits(10); txtTexto.setText(df.format(valorDouble)); But when you press a button it switches to scientific notation...
asked by 10.03.2015 / 13:55
1
answer

Difference between method and constructor?

Reading the notes of a friend I came across the following statement: "method does not allocate space in memory". Is this statement correct? Maybe it's not the main difference between them, but it's true to say that constructors allocate space...
asked by 18.12.2015 / 17:20