// apply 2-complement
//-2^(range-1) to 2^(range-1)-1
// there is 1 negatif more
// there is 1 positif less
// 8 bits signed
byte byteMin=-128;
byte byteMax=127;
//byte b0 = 128; does not compile
//byte bo=-129; does not compile
// 16 bits signed
short shortMin=-32768;
short shortMax=32767;
//short s0=-32769; does not compile
//short s0=32768; does not compile
// 16 bits unsigned
char charMin=0;
char charMax=65535;
//char c0=-1; does not compile
//char c1=65536; does not compile
char c2=65;
System.out.println("c2 : " + c2); // A
char c3='A';
System.out.println("c3 : " + c3);
// 32 bits signed
int intMin=-2147483648;
int intMax=2147483647;
//int i0=-2147483649; does not compile
//int i1=2147483648; does not compile
// 64 bits signed
long longMin = -9223372036854775808L;
long longMax = 9223372036854775807L;
//long l0=-9223372036854775809L; does not compile
//long l1=9223372036854775808L; does not compile
// 32 bits floating point
float floatMin=-2147483648f;
float floatMax=2147483647;
//float f0=-2147483649f; does not compile
//float f1=2147483648f; does not compile
float f2=1.0f; // f is mandatory because 1.0 is a double !!!
float f3=1.0e38f;
//float f4=1.0e39f; too large does not compile
// 64 bits floating point
double doubleMin=-9223372036854775808l; // L is mandatory because it is seen without as an integer
double doubleMax=9223372036854775807l;
//double d0=-9223372036854775809l; does not compile
//double d1=9223372036854775808l; does not compile
double d2=1.0e308d; // max
//double d3=1.0e309d; too large does not compile
This is some information on the Java 6 certification that I prepare. This information is not very well structured and it is most of the time an answer to the questions that come when I read the SCJP 6 book (Bates and Sierra). *** AS OF 5 OF MARCH 2010, I AM SCJP 6.0 ***
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2010
(38)
-
▼
January
(29)
- 28 - Review - xxxValue() - parseXxx() - valueOf()...
- 27 - Review - type of an array - level basic - Jav...
- 26 - Review - protected - level basic - Java 1.6.0...
- 25 - Review - private - level basic - Java 1.6.0_1...
- 24 - Thread : notify/notifyall- level basic - Java...
- 23 - Thread : deadlock - level basic - Java 1.6....
- 22 - Thread : same or different object ? - level ...
- 21 - example of Thread.join - level basic - Java ...
- 20 - non public class and public method - level ve...
- 19 - hashCode - level basic - Java 1.6.0_17 - NB 6.8
- 18 - Sorted Sets and a strange class - level basic...
- 17 - Arrays.sort example - level basic - Java 1.6....
- 16 - Comparable and Comparator - level basic - Ja...
- 15 - two ways to compare - level basic - Java 1.6....
- 14 - RegExp
- 13 - Example with transient (3)
- 12 - Example with transient (2)
- 11 - Example with transient (1)
- 10 - Netbeans does not seem to do anything !
- 9 - Local conversions
- 8 - Abstract classes and static methods
- 7 - Object Creation
- 0 - ERRATA - SCJP Sun Certified Programmer for Jav...
- 6 - visibility of interfaces and classes
- 5 - short and char
- 4 - classes public or not ?
- 3 - Forcing to catch Error
- 2 - Numerics
- 1 - Scope
-
▼
January
(29)
No comments:
Post a Comment