Содержание
- 2. Oddity The following method tests whether its argument is odd: public static boolean isOdd(int i) {
- 3. Making change public class Change { public static void main(String[] args) { System.out.println(2.00 - 1.10); }
- 4. Long Division public class LongDivision { public static void main(String[] args) { final long MICROS_PER_DAY =
- 5. Addition public class Addition { public static void main(String[] args) { System.out.println(12345 + 5432l); } }
- 6. Tweedledum Declare variables x and i such that x += i; is legal, but x =
- 7. Tweedledee Declare variables x and i such that x = x + i; is legal, but
- 8. += public class PlusEquals { public static void main(String[] args) { int i = 2; i
- 9. Last Laugh public class LastLaugh { public static void main(String[] args) { System.out.print("H" + "a"); System.out.print('H'
- 10. Indecision public class Indecisive { public static void main(String[] args) { System.out.println(decision()); } static boolean decision()
- 11. HelloGoodbye public class HelloGoodbye { public static void main(String[] args) { try { System.out.println("Hello world!"); System.exit(0);
- 12. The reluctant constructor public class Reluctant { private Reluctant internalInstance = new Reluctant(); public Reluctant() throws
- 13. Hello again public class Null { public static void main(String[] args) { ((Null)null).greet(); } public static
- 15. Скачать презентацию