Questions tagged as 'java'

2
answers

Why do certain services still depend on the Java plugin?

Banks, digital certificates, government service sites still depend on the plugin of Java. The idea of Java, "write once, run anywhere" is not always true. Many services still have platform-specific requirements, they only run on Windows...
asked by 25.02.2015 / 20:51
4
answers

Count distinct names saved in txt

I have a txt file with users' names separated by line as follows: diego sergio antonio maria diego antonio Note that names can repeat, and I would like to list and list only the distinguished names. I made this method to list the whole f...
asked by 16.02.2016 / 11:19
2
answers

Try and Catch continue execution (after exception)?

How do I put a block try and catch to continue the loop for , even if it gives arrayindexofbounds and among others exception? I put it in and it runs but the output of "m" does not print anything after! for (String f...
asked by 27.01.2015 / 11:11
2
answers

Full return of Date type

How do I get this return? 2014-08-05 18: 29: 47.757 Using Date . Date data = new java.sql.Date(new java.util.Date().getTime()); Using this my return is only 2015-02-03 and does not return the hours. NOTE: I need to get...
asked by 03.02.2015 / 15:14
1
answer

Java PriorityQueue Comparator

I'm trying to understand why the native java mode is not comparing, I do not know where I'm going wrong. MAIN // EXERCICIO PARA COMPARAR DOIS OBJETOS, USANDO CLASSE NATIVA DE COMPARAÇÃO DO JAVA public static void main(String[] args) {...
asked by 17.01.2018 / 12:11
2
answers

What is the best way to define access to the methods of a class I want to use for unit testing?

I have a Runnable class, which does a lot of things on my system. When I created her, I did not want to instantiate her methods out of her scope. So I wrote the methods as protected . Now, I'm trying to write some unit tests for...
asked by 12.07.2018 / 15:25
2
answers

What is the difference between EmbeddedId and IdClass in Hibernate?

I have read in the Hibernate 5.0 documentation that you can implement composite primary keys using two forms. The first one is using the @IdClass annotation and imitating the IdClass attributes in the original class. The other is using th...
asked by 14.06.2018 / 18:07
2
answers

How to consume an external API in Spring Boot

I have a springboot application that needs to extract information from another application. How do I make this communication and can I extract this data?     
asked by 09.05.2018 / 13:37
2
answers

JOptionPane, example?

Well, JOptionPane needs all these add-ons: JOptionPane.showOptionDialog(parentComponent, message, title, optionType, messageType, icon, options, initialValue); Could you give an example of all of these complements filled out...
asked by 18.08.2014 / 19:24
3
answers

What does it mean to assign Math.random () 0.5 to a variable?

What does this Math.random() > 0.5; mean in boolean ? Here is an example: class Pro { public static void main(String[] args) { int numero = 10; boolean[] array = new boolean[numero]; for(int i= 0;...
asked by 14.02.2016 / 22:48