Questions tagged as 'java'

3
answers

Is it possible to test only specific classes?

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...
asked by 09.12.2015 / 19:42
4
answers

Turn MD5 MessageDigest into string

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...
asked by 20.07.2016 / 14:31
1
answer

Get values separated by spaces in Java

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.     
asked by 23.06.2015 / 16:11
2
answers

Find out how many days have passed from one date to another

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...
asked by 23.04.2015 / 22:11
2
answers

Can an int be equal to null?

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 ?
asked by 24.05.2015 / 05:34
4
answers

In Object Orientation, does an inheritance violate the encapsulation?

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...
asked by 22.03.2016 / 19:36
7
answers

How to test if an EditText is empty?

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...
asked by 12.09.2015 / 02:20
2
answers

While with incomprehensible format

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);...
asked by 12.11.2015 / 03:26
3
answers

Is there a naming pattern for enums?

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 , ... ???    ...
asked by 17.07.2015 / 15:54
3
answers

Problem with records (Column count does not match value count at row 1)

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...
asked by 18.11.2014 / 00:31