Questions tagged as 'java'

2
answers

What is the behavior of the reference variable and the primitive variable?

What is the behavior of a variable of type reference (null) and primitive type (0) in memory before being initialized. Where are they in memory?     
asked by 31.08.2015 / 16:08
2
answers

What is the purpose of the "persistence.xml" file?

I am studying Hibernate , and on the way I came across several doubts, one of my doubts, and what is important for my learning, is about the purpose of the persistence.xml that is my unit of persistence, I read about it, however, I can...
asked by 06.04.2016 / 23:14
2
answers

What is wrong with multi-thread implementation?

The implementation below is merely a test class to test competition in Java. Several Threads are created that execute a method that makes a sum, then a return is displayed showing the result of the sum. According to the values already implemente...
asked by 09.04.2016 / 21:03
1
answer

Array with dynamic capability and how to invalidate other characters in reading

I made the code below but I found 2 problems: The vector value is set to 100 and should be the number of numbers the user wants. Another problem I found is that the statement specifies that there should be a validation if the user enters i...
asked by 17.09.2016 / 16:26
1
answer

Return data obtained from OnResponse

How do I return this String reponse? If I give the return there it does not accept ... and if and by at the end of the method and using an auxiliary variable it risks returning null. public String getData(){ StringRequest request = new Str...
asked by 20.10.2016 / 01:41
1
answer

General namespace for mapped class

Can anyone help me with this question? Based on a result XML from a WebService (OBIEE) I generated an XSD in a online converter and with this XSD I generated the class mapped by means of the command xjc . When I tried to play the XM...
asked by 06.04.2015 / 22:18
2
answers

How to avoid NoClassDefFoundError?

I'm developing a project that has many classes, and many .java files, and from time to time, from time to time, this problem happens, randomly. Let's say: A class that I used, is working perfectly, out of nowhere if it "rebels" and resolves to g...
asked by 15.06.2016 / 14:42
1
answer

Thread lifetime in java

When an object, from a class that implements a thread, is destroyed (loses reference) does the thread for that object stop?     
asked by 06.07.2016 / 14:54
2
answers

Enabling Internet Connection in an Android Application

I would like to know a way to identify if the android cell phone is connected to the internet independently if it is the mobile network of the mobile or wifi carrier, and if it is not connected, I activate all connections both wifi and mobile da...
asked by 20.07.2015 / 21:23
3
answers

Discovering SQL from a ResultSet

I have a java ResultSet object that does not know the SQL / Parameters that generated it. I would like to know how do I get the SQL used to create it? would have something like: rs.getStm.getSql ?     
asked by 21.07.2015 / 22:11