Questions tagged as 'java'

2
answers

Pass parameter without specifying the type of the variable to receive in the function

I'm creating a function in Java that returns the type of the variable and as such, since I'm trying to figure out its type, I have no way of telling the function what type of variable to expect. What I'm trying to build is the following: pub...
asked by 12.01.2015 / 15:42
1
answer

Txt file not found when generating .jar file

I have a Java application, this application has images, and I had the same problem: when I generated the .jar (executable) file the images did not appear, but if I were to run directly in NetBeans, it would appear. I solved the problem by puttin...
asked by 28.11.2015 / 21:17
2
answers

The if statement in java is not working inside a method

I'm a beginner and I'm not getting my code to work as expected with the if / else. I'm using this command within a method and doing it as follows: private boolean AutentificaSenha(String s) { this.aSenha = s; boolean cond = this.s...
asked by 04.07.2015 / 00:04
3
answers

What is the function of the "!" (exclamation) operator? [duplicate]

In this method: public boolean aplicaDescontoDe(double porcentagem) { if(porcentagem > 0.3) { return false; } else { this.valor -= valor * porcentagem; return true; } } What does the ! operato...
asked by 18.01.2016 / 20:42
2
answers

What is the relationship between JPA and ORM?

I wanted to know the relationship between JPA and ORM because I was in doubt, if both, deal with the same subject.     
asked by 30.11.2015 / 22:07
2
answers

What is the difference between keywords extends and implements in java?

I would like to know when they should be used and how we can distinguish them. I know that basically implements means that this class implements a class or an interface. E extends will be able to access the methods of the base class.     
asked by 28.03.2017 / 13:05
2
answers

Swap blanks for% 20 in Java

I have the following URL: String Url = "www.minhaUrl/pagina/meus parametros tem espaços em branco"; I need to turn it into: String Url = "www.minhaUrl/pagina/meus%20parametros%20tem%20espaços%20em%branco";     
asked by 15.03.2017 / 18:07
2
answers

After all, is Java a platform or a programming language?

I see several materials referring to Java as a technology (platform) and others as a programming language.     
asked by 02.01.2018 / 21:57
2
answers

Is it possible to perform an assignment and comparison in if clauses in Java?

Is it possible to assign and at the same time perform a comparison in an if clause in Java? For example: String linha = leitor.readLine(); String saida = ""; if (linha = leitor.readLine()) { saida += "\n"; } This does not seem to wor...
asked by 09.02.2014 / 22:46
1
answer

Can not update my app on google play?

I know that it is necessary to change the version number, but when I make the change and try to generate an apk it gives an error and shows me a message ... Error: XML version "2.0" not supported; only XML 1.0 is supported.     
asked by 22.02.2015 / 02:52