Questions tagged as 'java'

1
answer

Libraries, interface, classes and methods

What's the difference between libraries and interfaces? For example, in the line: import java.util.Scanner; Would util be the interface and Scanner of the class? Or would util be the library and Scanner would...
asked by 08.09.2015 / 14:43
3
answers

Is the finally block always executed in Java? [duplicate]

In this code there is a try / catch block with a return inside it. try { alguma_coisa(); return successo; } catch (Exception e) { return falha; } finally { System.out.println("Eu não sei se será possível...
asked by 24.08.2015 / 22:18
5
answers

How to change the value of two variables in Java?

Is it possible to create a function in Java that changes the value of two variables without having to declare a temporary variable? For example: int a = 8, b = 3; if(a > b) { // algo aqui, sem declarar uma variável "tmp" } // agora a...
asked by 04.02.2014 / 13:04
1
answer

Fullscreen Video on Android Webview

I have an application made in Android Studio that uses webview and runs a remote web application. The video is displayed perfectly in the webview. However, the fullscreen option is not available in the embedded player on the page. See the...
asked by 10.08.2017 / 17:53
1
answer

How to calculate the difference between two dates ignoring the weekends in Java without using loop

I was looking for a solution to this problem but I did not find a satisfactory algorithm, so I decided to create the algorithm. Hope it works for someone. public int betweenDaysIgnoreWeekends(DateTime startDate, DateTime endDate) { //Um nu...
asked by 29.08.2014 / 11:52
1
answer

What is the purpose of "&" in the generic type declaration?

In this code , the author creates a class as follows: public abstract class GlyphIcon<T extends Enum<T> & GlyphIcons> extends Text { /* ... */ } My question is to understand the meaning of this & in the followi...
asked by 20.02.2016 / 09:56
1
answer

Differences @OneToMany, @ManyToMany, @ManyToOne, @OneToOne [duplicate]

I wanted to mount a database with Java Hibernate like the one below: Questions: What is the difference between @OneToMany , @ManyToMany , @ManyToOne , @OneToOne ? And what would your statement look like in...
asked by 04.09.2017 / 20:26
3
answers

Scrypt, Bcrypt or anything else

I am choosing a hash algorithm for the passwords of a system I develop. At the beginning of my "programmatic" I used MD5 , SHA-1 and its derivants. After a while I chose Whirlpool and now I'm looking for something more robust...
asked by 27.02.2014 / 19:04
2
answers

Creating JAR with Dependencies in Maven

I want to use Maven to generate the JAR with its dependencies in .jar format, the solutions I found are not valid. Eclipse has three ways to generate an executable JAR. Extract required libraries into gerenated JAR Package...
asked by 06.03.2014 / 13:08
4
answers

Within a decision structure, does the order of the terms change the result?

Is there any difference between: if (variavelA == variavelB) and if (variavelB == variavelA) In Java and C #, is there any difference between the examples? I emphasize that the question is not limited only to the == operator, bu...
asked by 25.05.2014 / 18:30