Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Trap Questions in Java and Obj-C
Search
417.72KI
December 03, 2019
Programming
1
280
Trap Questions in Java and Obj-C
417.72KI
December 03, 2019
Tweet
Share
More Decks by 417.72KI
See All by 417.72KI
iTunes・おぼえていますか〜ScriptingBridge今昔物語〜
417_72ki
1
31
The history of entry-point in iOS app Development
417_72ki
0
380
R.swift to Asset Symbols
417_72ki
0
270
Refactor with using `available` and `deprecated`
417_72ki
3
620
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
410
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
910
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.5k
Mockable UserDefaults with Duck typing
417_72ki
0
890
Other Decks in Programming
See All in Programming
良いユニットテストを書こう
mototakatsu
11
3.6k
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
13
2.1k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5k
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
110
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
200
functionalなアプローチで動的要素を排除する
ryopeko
1
190
AWS re:Invent 2024個人的まとめ
satoshi256kbyte
0
100
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
1.1k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
How STYLIGHT went responsive
nonsquared
96
5.3k
Producing Creativity
orderedlist
PRO
343
39k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Code Review Best Practice
trishagee
65
17k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Building Adaptive Systems
keathley
38
2.4k
Visualization
eitanlees
146
15k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Transcript
4XJGU,PUMJOѪձ 7PM !(.0ϖύϘ
4XJGUͱ,PUMJO
4XJGUͱ,PUMJO
+BWBͱ0CKFDUJWF$ ͷΛ͠·͢
ͳΜͰࠓ͞Β+BWB0CK$
ͳΜͰࠓ͞Β+BWB0CK$ w ࠓͷ࣌ΞϓϦ4XJGU,PUMJOͰॻ͘ͷ͕ͨΓલ w ࠓͲ͖+BWB0CK$ͳΜͯ৮ΒΜΖ
Ռͨͯ͠ຊʹͦ͏ͩΖ͏͔ʁ
Ռͨͯ͠ຊʹͦ͏ͩΖ͏͔ʁ w 044ϥΠϒϥϦϦϦʔε͞Εͨ࣌ϥΠϒϥϦͷಛ ੑ্+BWB0CK$Ͱॻ͔Ε͍ͯΔͷ·ͩ·ͩଟ͍ w ࣮Λ֬ೝͨ͠Γ13Λग़ͨ͠Γ͢ΔͳΒͬͺΓͦͷล ͷࣝඞཁ
ͱ͍͏͜ͱͰ
ҙ֎ͱҾ͔͔ͬΔʂʁ ݴޠ༷ΫΠζ +BWB0CKFDUJWF$ฤ
w 5BLVIJSP.VUBBLB໊Նر ,* w 4& 8FC J04 "OESPJE ৽ਓݚमߨࢣFUD
J04 डୗ։ൃ J04 ࣗࣾ։ൃ ࠓίί w 5XJUUFS 2JJUB@LJ (JU)VC,* w 4XJGUѪձࢀՃप ͏ΜΧϨʔ ͓લ୭Α
#VJME$POpHTXJGU ελʔ͍ͩ͘͞
ݴޠ༷ΫΠζ w +BWB w 0CKFDUJWF$
+BWBฤ
ୈ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } }
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
ղઆ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } } 6OSFBDIBCMFDPEF
ୈ
ୈΛ౿·͑ͯ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } }
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ do { System.out.println("hoge"); } while (false); } }
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ do { System.out.println("hoge"); } while (false); } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ do { System.out.println("hoge"); } while (false); } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
public class Sample { public static void main(String... args) {
do { System.out.println("hoge"); } while (false); } } ղઆ EPXIJMFࣄޙධՁ ճॲཧͨ͠ޙʹ݅ࣜΛఆ
ղઆ ॲཧ ݅ XIJMF ॲཧ ݅ EPXIJMF
0CKFDUJWF$ฤ
ୈ
Կ͕ग़ྗ͞ΕΔʁ
Կ͕ग़ྗ͞ΕΔʁ if (@0) { NSLog(@"true"); } else { NSLog(@"false"); }
Կ͕ग़ྗ͞ΕΔʁ if (@0) { NSLog(@"true"); } else { NSLog(@"false"); }
USVF GBMTF
Կ͕ग़ྗ͞ΕΔʁ if (@0) { NSLog(@"true"); } else { NSLog(@"false"); }
USVF GBMTF
ղઆ w @0</4/VNCFSOVNCFS8JUI*OU>ͷ4ZOUBY4VHBS w /4/VNCFSΦϒδΣΫτ w ΦϒδΣΫτͱͯ͠ଘࡏ͢ΔͨΊɺ USVFͱͯ͠ఆ͞ΕΔ w @NOಉ༷
ୈ
Կ͕ग़ྗ͞ΕΔʁ
Կ͕ग़ྗ͞ΕΔʁ [ "hoge", "fuga", null, "foo", "bar" ] TBNQMFKTPO NSArray
*array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
Կ͕ग़ྗ͞ΕΔʁ USVF GBMTF [ "hoge", "fuga", null, "foo", "bar" ]
TBNQMFKTPO NSArray *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
Կ͕ग़ྗ͞ΕΔʁ USVF GBMTF [ "hoge", "fuga", null, "foo", "bar" ]
TBNQMFKTPO NSArray *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
ղઆ w /4"SSBZͷίϨΫγϣϯʹOJMΛೖΕΔ͜ͱ͕Ͱ͖ͳ ͍ w େମखஈͱͯ͠/4/VMMͱ͍͏ΫϥεΛ͏ w ͜ͷ࣌BSSBZ<>͔ΒऔΓग़͞ΕΔͷ</4/VMMOVMM>ͱ͍͏ γϯάϧτϯΦϒδΣΫτ w
ΦϒδΣΫτͳͷͰUSVFͱͯ͠ఆ͞ΕΔ
/4/VMMͱOJM NSLog(@"%@", nil); // -> (null) NSLog(@"%@", [NSNull null]); //
-> <null> ྻʹฆΕ͍ͯΔOVMMΑ͘ݟམͱ͕ͪ͠
͜ΜͳΜͬͯͯԿʹͳΔʁ
͜ΜͳΜͬͯͯԿʹͳΔʁ w +BWB w 0$+1 0SBDMFೝఆࢿ֨ Ͱ͜͏͍͏͕ग़͞ΕΔ w ࣮Ͱ͏ҙຯ໓ଟʹແ͍͕ɺ ϨΨγʔͳγεςϜͰۃكʹฆΕࠐΜͰΔ
w ϦʔμϒϧίʔυͬͯͬͯΔʁ
͜ΜͳΜͬͯͯԿʹͳΔʁ w 0CK$ w ҙ֎ͱݟམͱ͕ͪ͠ w ͜ͷखͷޡղ͔ΒੜͣΔόά͕࣮ࡍʹ͋ͬͨ w 4XJGUͷϦϓϨʔεͰఆͱҧ͏ಈ͖Λ͢Δͱ͔ w
ಛʹྻʹฆΕࠐΉOVMM͋Δ͋Δ
͜ΜͳΜͬͯͯԿʹͳΔʁ w ͍ͭͰʹ w ৽ਓݚमͰυϠΕΔ
·ͱΊ w ϨΨγʔݴޠͷཧղϦϓϨʔεͷڧ͍ຯํ w ࢥΘ͵όάΛੜ·ͳ͍ͨΊʹݴޠ༷ͷཧղେ w ࣮ͰΘͳ͍͔ࣝͩΒͬͯܰࢹ͠ͳ͍Α͏ʹ
ྑ͍͓Λʂ✋