Questions tagged as 'java'

4
answers

What is the function super (); [duplicate]

I'm studying Java and I need to understand the logic of a code here. I wanted to know what this snippet does: public class UsuarioController extends HttpServlet { private DAO dao; public UsuarioController() { super();...
asked by 29.05.2015 / 13:22
3
answers

Difference of null and other proposition using this null object

If I have a code, for example: if(window!=null && window.isOpen()){ //todo } If window is null , will it still try to call the second proposition or not check anymore? Because if it tries to call, then it will give...
asked by 25.08.2016 / 14:06
4
answers

Different methods of creating an object

What is the difference between these two types of creation / instantiation of an object? Usuario usuario = new Usuario(); usuario.listar(); new Usuario().listar();     
asked by 22.10.2016 / 22:45
1
answer

What is the difference of Integer.valueOf () when using String or int parameters?

Why are the results of System.out different in the lines below? Integer teste = Integer.valueOf("0422"); Resultado: 422 Integer teste = Integer.valueOf(0422); Resultado: 274 If you pass a int it changes the original value, no...
asked by 17.09.2014 / 16:15
0
answers

StackOverflowError - Infinite loop when deploying ear with ejb and demoiselle

When deploying an EAR with an EJB that depends on demoiselle-core , a StackOverflowError exception is thrown. When you try to create a ResourceBundle (ResourceBundleProducer.createNamed (ResourceBundleProducer.java:77)), the Beans class (...
asked by 29.01.2015 / 13:09
3
answers

Change the format of a date (time) that is in a String

I have two strings that receive hours, in this case, ArrivalTime and DepartureTime. The next format is HH: MM: SS. I would like to format this string for HH: MM how can I do this? I enter this text in ToggleButtons (setTextOn and setTextOff)....
asked by 20.10.2016 / 18:54
2
answers

How to invert series of denied conditions without affecting logic?

Could anyone explain why this happens? My apk only works right if I put denial and do something: public class Main2Activity extends AppCompatActivity { private EditText nome, teste, cpf; private Button button; @Override protect...
asked by 19.12.2016 / 00:33
1
answer

Execute commands or cmd scripts by java do not work [duplicate]

I'm having trouble executing some commands through java. If I run them directly from Netbeans or run the project directly from my machine it works perfectly any of the commands below: String comando = "cmd /c \"//Server/Sistema/Scripts/execu...
asked by 12.06.2017 / 14:31
2
answers

Some errors on Android [closed]

I'm trying to start programming on Android. I created the project and came up with this code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tela_1); } @Over...
asked by 29.08.2015 / 18:13
3
answers

How do I generate a random negative number?

I can not generate a random number that is negative, for example less than 0     
asked by 25.02.2017 / 13:34