Press enter to see results or esc to cancel.

Java primitive data type sizes for byte, short, int, long, float, double and char

A handy list for Java data types and sizes Integer Data Types Data Type Size Digits Min Max byte 8-bit signed 3 -128 127 short 16-bit signed 5 -32,768 32,767 int 32-bit signed 10 -2,147,483,648 2,147,483,647 long 64-bit signed 19 -9,223,372,036,854,775,808 9,223,372,036,854,775,807 Floating Point Data Types Data Type Size float single-precision 32-bit IEEE 754 floating …

Continue reading

JUnit 4 error: reference to assertEquals is ambiguous

This is a somewhat confusing compilation failure that sometimes happen when you write unit tests using JUnit 4. This is an example code snippet that produces this error (result.getValue() returns an Integer object): assertEquals(12345, result.getValue()); And when you try to compile your project it produces a compilation error like this: /projects/myapp/src/test/java/org/myapp/MyTest.java:[88,8] reference to assertEquals is …

Continue reading