public static void main(String[] args) {
short a=5;
a+=10;
a%=2; // OK
// a=a+10; // does not compile - possible loss of precision
a=(short)(a+10);
char b=5;
b+=10;
// b=b+10; // does not compile - possible loss of precision
b=(char)(b+10);
b%=2; // OK
}
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