Questions tagged as 'java'

5
answers

Is it possible to change the type of the variable in Java?

Is it possible to change the type of my variable in Java? For example, I created a variable x , being a Double : double x; I want to continue using my variable x but it is now a int : int x; Is this possible?...
asked by 19.02.2015 / 22:02
2
answers

Is there any way to run a java (.jar) program from a C or C ++ program?

I want to know if there is a way I can write a program .jar , and write a C / C ++ program that calls the JVM to execute the .jar file. It's possible? If so, can you give me an example code or an instruction how to do this?     
asked by 25.07.2016 / 03:26
2
answers

Calculate difference between dates

I need to calculate the difference between the date of registration and the current date, if it is greater than 6 months, return Boolean. I am registering the bank on the date of registration as follows: public static final String DATE_FORMAT_...
asked by 15.11.2015 / 16:08
4
answers

Is method overload less performative?

I was reading about interfaces as part of my studies and came across an overloading class of methods, with two comments saying that this should be avoided. I was in doubt about it affecting the performance. Affect?     
asked by 21.10.2017 / 06:15
2
answers

JAAS or Spring Security in page control

I'm doing a project in Eclipse with JSF 2.2, JPA 2.1, Hibernate 5, Primefaces 5.3, CDI (weld 1.1). I want to implement the security part of the application and I am in doubt between JAAS and Spring Security. The template below corresponds...
asked by 01.12.2015 / 14:30
2
answers

What is the best way to run a java application as a Service on Windows (32 or 64 bit)?

What you need to do to run a Java application (without visual interface) as a Windows service. The program basically uses the Filesystem API and the network API (java.net, java.io and java.nio) If you need to build from the sources I'd like t...
asked by 21.02.2014 / 20:59
2
answers

How to create regexReplace for a delimiter?

I have the following content: 123|321|1234\|56\|teste\||123 I would like to make a regex replace that would replace all | with line break and ignore | escaped with \ , so I would like to get the following return:...
asked by 21.01.2014 / 12:08
2
answers

What is the var difference between Kotlin and Java?

With the release of Java 10, the possibility of using var was introduced: var list = new ArrayList<String>(); I have already seen what is the difference between
asked by 25.05.2018 / 22:12
2
answers

How to create a C program and use graphical Java / C # interface?

I'm studying graphical interface in C, and I realized it's very complex and tiring. So I wanted to know if there is a way to create a C program and use a graphical interface in Java or C #. With frameworks or not ...     
asked by 07.09.2015 / 20:26
2
answers

Why invert the index of the array in a for, to popular the array, makes the process faster?

I was doing some tests in Java and noticed a very strange behavior. I made a two-dimensional array and populated the array in two different ways, filling in random numbers up to 2 ^ 31-1 and just changing its index. I got a considerable performa...
asked by 13.03.2014 / 04:09