Trap Questions in Java and Obj-C

7a78f23eef1b0e883ef44c229a54f0bb?s=47 417.72KI
December 03, 2019

Trap Questions in Java and Obj-C

7a78f23eef1b0e883ef44c229a54f0bb?s=128

417.72KI

December 03, 2019
Tweet

Transcript

  1. 11.

    w 5BLVIJSP.VUBBLB௣໊Նر ,*  w 4&೥ 8FC J04 "OESPJE ৽ਓݚमߨࢣFUD

    
 J04 डୗ։ൃ ೥൒
 J04 ࣗࣾ։ൃ ࠓίί w 5XJUUFS 2JJUB@LJ
 (JU)VC,* w 4XJGUѪ޷ձࢀՃप೥
 ΋͏΍ΜΧϨʔ͸೥໨ ͓લ୭Α
  2. 14.
  3. 15.
  4. 18.

    ࣍ͷίʔυͷಈ͖͸Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)

    { while (false) { System.out.println("hoge"); } } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կ΋ى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
  5. 19.

    ࣍ͷίʔυͷಈ͖͸Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)

    { while (false) { System.out.println("hoge"); } } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կ΋ى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
  6. 20.

    ղઆ public class Sample { public static void main(String... args)

    { while (false) { System.out.println("hoge"); } } } 6OSFBDIBCMFDPEF
  7. 21.
  8. 22.

    ୈ໰Λ౿·͑ͯ public class Sample { public static void main(String... args)

    { while (false) { System.out.println("hoge"); } } }
  9. 23.
  10. 24.

    ࣍ͷίʔυͷಈ͖͸Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)

    { do { System.out.println("hoge"); } while (false); } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կ΋ى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
  11. 25.

    ࣍ͷίʔυͷಈ͖͸Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)

    { do { System.out.println("hoge"); } while (false); } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կ΋ى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
  12. 26.

    public class Sample { public static void main(String... args) {

    do { System.out.println("hoge"); } while (false); } } ղઆ EPXIJMF͸ࣄޙධՁ ճॲཧͨ͠ޙʹ৚݅ࣜΛ൑ఆ
  13. 29.
  14. 35.
  15. 37.

    Կ͕ग़ྗ͞ΕΔʁ [ "hoge", "fuga", null, "foo", "bar" ] TBNQMFKTPO NSArray

    *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
  16. 38.

    Կ͕ग़ྗ͞ΕΔʁ USVF GBMTF [ "hoge", "fuga", null, "foo", "bar" ]

    TBNQMFKTPO NSArray *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
  17. 39.

    Կ͕ग़ྗ͞ΕΔʁ USVF GBMTF [ "hoge", "fuga", null, "foo", "bar" ]

    TBNQMFKTPO NSArray *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
  18. 41.

    /4/VMMͱOJM NSLog(@"%@", nil); // -> (null) NSLog(@"%@", [NSNull null]); //

    -> <null> ഑ྻʹฆΕ͍ͯΔOVMM͸Α͘ݟམͱ͕ͪ͠