I have two test classes:
class A {
@Test
public void fazAlgo(){
// ...
}
}
class B {
@Test
public void fazAlgoMesmo(){
// ...
}
}
My tests are taking a long time because all classes are being tested. Ther...
I'm trying to generate an MD5 hash using the MessageDigest class, but I can not correctly display the hash as a string. The result is a string of unknown characters.
Below is the test code:
import java.security.MessageDigest;
import...
Could someone explain to me how I can get values separated by spaces in Java?
For example, the user informs all at once the following values: 1 2 3 and I have to put each value in a variable.
In a java program, where the person inserts the day first, then the month, then the year, how do I know how many days have passed from that date inserted until a later date that will also be reported by the person?
For example:
First reported da...
After seeing a question about this, and many college colleagues with doubts attached to it, I decided to ask this question.
Type int can be equal to null ?
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides , write the following statement:
"... inheritance violates the encapsulation."
Below is the paragraph that contains this statement:
" ... class inheritance also has some...
I would like to know how do I test if an EditText is empty or populated in Android.
For example, I want to make an app that will perform a registration, but there are fields that can not be empty so I would like to know how to do this test, in...
My knowledge of java is very basic, and I came across a question that I have not yet answered. The code snippet below is used in some of my applications:
File arquivo = new File("ip.txt");
FileInputStream fis = new FileInputStream(arquivo);...
I do not understand much of object naming pattern. I am creating a enum that enumerates positions, for example: manager, programmer, attendant ...
Is there a standard to name this enum? EnumCargo , CargoEnum , ... ???
...
I'm having the error "Column count does not count value at row 1" when I try to register. I have already checked my DB and everything seems to be in order but nothing to solve this error.
My registration code.
public void action...