{"id":18203,"date":"2025-07-14T10:00:13","date_gmt":"2025-07-14T01:00:13","guid":{"rendered":"https:\/\/www.ecomottblog.com\/?p=18203"},"modified":"2025-07-11T20:11:31","modified_gmt":"2025-07-11T11:11:31","slug":"%e3%81%be%e3%81%a0%e7%9f%a5%e3%82%89%e3%81%aa%e3%81%84kotlin%e3%81%ae%e4%b8%96%e7%95%8c","status":"publish","type":"post","link":"https:\/\/www.ecomottblog.com\/?p=18203","title":{"rendered":"\u307e\u3060\u77e5\u3089\u306a\u3044Kotlin\u306e\u4e16\u754c"},"content":{"rendered":"<p>\u30af\u30e9\u30a6\u30c9\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u90e8\u306e\u4eca\u91ce\u3067\u3059\uff01<\/p>\n<p>\u300cAndroid\u30a2\u30d7\u30ea\u3063\u3066Java\u3067\u4f5c\u308c\u3061\u3083\u3046\u304b\u3089Java\u3067\u4f5c\u308d\u3046\u300d<\/p>\n<p>\u300cKotlin\u3063\u3066Android\u30a2\u30d7\u30ea\u306b\u3057\u304b\u4f7f\u7528\u3067\u304d\u306a\u3055\u305d\u3046\u300d<\/p>\n<p>\u300c \u3042\u30fc\u8a00\u8a9e\u5b66\u7fd2\u306e\u30cf\u30fc\u30c9\u30eb\u9ad8\u305d\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u300d<\/p>\n<p>\u975e\u5e38\u306b\u3082\u3063\u305f\u3044\u306a\u3044\uff01<\/p>\n<p>\u3068\u3044\u3046\u304a\u8a71\u3092\u4eca\u56de\u306f\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>Kotlin\u3001\u975e\u5e38\u306b\u4fbf\u5229\u306a\u8a00\u8a9e\u306a\u3093\u3067\u3059\u3002<\/p>\n<p>\u4e00\u5ea6\u66f8\u3044\u305f\u3089\u75c5\u307f\u3064\u304d\u9593\u9055\u3044\u306a\u3057\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fAndroid\u30a2\u30d7\u30ea\u958b\u767a\u3067Kotlin\u3092\u4f7f\u3063\u305f\u6642\u306e\u9b45\u529b\u306b\u3064\u3044\u3066\u304a\u4f1d\u3048\u3057\u3066\u3044\u304d\u307e\u3059\uff01<\/p>\n<p><!--more--><\/p>\n<h2>Google\u63a8\u5968\u8a00\u8a9e<\/h2>\n<p>Kotlin\u306fJetBrains\u793e\u306b\u3088\u308a2011\u5e74\u306b\u516c\u958b\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>Google\u306f2017\u5e74\u306bKotlin\u3092Android\u958b\u767a\u63a8\u5968\u8a00\u8a9e\u306b\u8a8d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Android \u30a2\u30d7\u30ea\u3060\u3051\u3067\u306a\u304f\u3001iOS\u30a2\u30d7\u30ea\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3082\u53ef\u80fd\u306a\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n<h2>\u30bb\u30df\u30b3\u30ed\u30f3\u4e0d\u8981\uff01<\/h2>\n<p>\u30b3\u30fc\u30c9\u306b\u30bb\u30df\u30b3\u30ed\u30f3\u306f\u4e0d\u8981\u3067\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<p>\u5730\u5473\u306b\u4fbf\u5229\u306a\u3093\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<\/p>\n<p>Java<\/p>\n<pre class=\"lang:java decode:true\" title=\"Java\">String str = \"hello\";<\/pre>\n<p>Kotlin<\/p>\n<pre class=\"lang:java decode:true\" title=\"Kotlin\">var str: String = \"hello\"<\/pre>\n<p>\u30bb\u30df\u30b3\u30ed\u30f3\u3088\u3055\u3089\u3070\uff01<\/p>\n<h2>\u30c7\u30fc\u30bf\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u306b\u77ed\u3044\u30b3\u30fc\u30c9\u3067\u66f8\u3051\u308b<\/h2>\n<p>\u307e\u305a\u306fJava\u306e\u30b3\u30fc\u30c9\u304b\u3089\u3002<\/p>\n<p>Java<\/p>\n<pre class=\"lang:java decode:true\" title=\"Java\">public class User {\n    private final String name;\n    private final int age;\n\n    public User(String name, int age) {\n        this.name = name;\n        this.age = age;\n    }\n    public String getName() { return name; }\n    public int getAge() { return age; }\n    @Override public boolean equals(Object o){ \/* \u7565 *\/ }\n    @Override public int hashCode(){ \/* \u7565 *\/ }\n    @Override public String toString(){ \/* \u7565 *\/ }\n}\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001equals\u30fbhashCode\u30fbtoString\u306e\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7d9a\u3044\u3066Kotlin\u3067\u3059\u3002<\/p>\n<pre class=\"lang:java decode:true \" title=\"Kotlin\">data class User(val name: String, val age: Int)<\/pre>\n<p>\u3053\u306e\u4e00\u6587\u3060\u3051\u3067getter\u30fbequals\u30fbhashCode\u30fbtoString \u304c\u81ea\u52d5\u751f\u6210\u3067\u304d\u3061\u3083\u3044\u307e\u3059\u3002<\/p>\n<h2>Null\u6642\u3082\u5b89\u5fc3<\/h2>\n<p>Kotlin \u306f\u578b\u30b7\u30b9\u30c6\u30e0\u306b\u300cNullable \u578b\u300d\u3068\u300cNon-null \u578b\u300d\u3092\u7d44\u307f\u8fbc\u307f\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30cc\u30eb\u53c2\u7167\u3092\u9632\u6b62\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Java<\/p>\n<pre class=\"lang:java decode:true \" title=\"Java\">\/\/ Java: NPE \u306e\u5371\u967a\u3042\u308a\nString s = possiblyNull();\nint len = s.length();  \/\/ NPE \u306e\u53ef\u80fd\u6027<\/pre>\n<p>Kotlin<\/p>\n<pre class=\"lang:java decode:true \" title=\"Kotlin\">\/\/ Kotlin: \u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\uff0f\u5b89\u5168\u547c\u3073\u51fa\u3057\nval s: String? = possiblyNull()\nval len = s?.length ?: 0  \/\/ null \u306e\u5834\u5408\u306f 0 \u3092\u8fd4\u3059\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306bnull\u6642\u306e\u30ea\u30b9\u30af\u3092\u6e1b\u3089\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>Swift\u306b\u66f8\u304d\u65b9\u304c\u4f3c\u3066\u3044\u308b<\/h2>\n<p>\u62e1\u5f35\u6a5f\u80fd\u5b9f\u88c5\u6642\u306eSwift\u3068\u3082\u6bd4\u8f03\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Swift<\/p>\n<pre class=\"lang:swift decode:true\" title=\"Swift\">let message = \"Hello, Swift\"      \/\/ String \u3068\u63a8\u8ad6\nvar count = 0                     \/\/ Int \u3068\u63a8\u8ad6\n\nextension String {\n  func isEmail() -&gt; Bool {\n    \/\/ \u6b63\u898f\u8868\u73fe\u3067\u30c1\u30a7\u30c3\u30af\u2026\n    return self.contains(\"@\")\n  }\n}<\/pre>\n<p>Kotlin<\/p>\n<pre class=\"lang:java decode:true \" title=\"Kotlin\">val message = \"Hello, Kotlin\"     \/\/ String \u3068\u63a8\u8ad6\nvar count = 0                     \/\/ Int \u3068\u63a8\u8ad6\n\nfun String.isEmail(): Boolean {\n  \/\/ \u6b63\u898f\u8868\u73fe\u3067\u30c1\u30a7\u30c3\u30af\u2026\n  return contains(\"@\")\n}<\/pre>\n<p>\u578b\u5b9a\u7fa9\u3068\u62e1\u5f35\u6a5f\u80fd\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u304c\u3001<\/p>\n<p>Swift \u3082 Kotlin \u3082\u3001\u5909\u6570\u5ba3\u8a00\u6642\u306b\u578b\u3092\u307b\u3068\u3093\u3069\u660e\u793a\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001\u53f3\u8fba\u304b\u3089\u578b\u3092\u63a8\u8ad6\u3057\u307e\u3059\u3002<\/p>\n<p>\u65e2\u5b58\u30af\u30e9\u30b9\u306b\u30e1\u30bd\u30c3\u30c9\u3092\u300c\u8ffd\u52a0\u300d\u3067\u304d\u308b\u4ed5\u7d44\u307f\u3082\u5171\u901a\u3067\u3059\u3002<\/p>\n<h2>iOS\u30a2\u30d7\u30ea\u958b\u767a\u3082\u53ef\u80fd\uff01<\/h2>\n<p>\u5148\u307b\u3069\u306e\u6587\u3092\u898b\u3066\u3001\u52d8\u306e\u92ed\u3044\u65b9\u306f\u6c17\u3065\u304f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>Android\u30a2\u30d7\u30ea\u306e\u958b\u767a\u8a00\u8a9e\u306a\u306e\u306b\u3001iPhone\u30a2\u30d7\u30ea\u3082\u4f5c\u308c\u308b\u306e\u2026\uff1f<\/p>\n<p>\u4f5c\u308c\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>JetBrains\u793e\u304c\u30ea\u30ea\u30fc\u30b9\u3057\u3066\u3044\u308bKotlin Multiplatform\u3092\u4f7f\u3063\u3066\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.jetbrains.com\/ja-jp\/kotlin-multiplatform\/\">https:\/\/www.jetbrains.com\/ja-jp\/kotlin-multiplatform\/<\/a><\/p>\n<p>\u305f\u3060\u3001\u5b9f\u8cea\u306fSwift\u5074\u3067\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u3066\u3001Kotlin\u306e\u30b3\u30fc\u30c9\u3092\u30d6\u30ea\u30c3\u30b8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u7ba1\u7406\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Kotlin\u306e\u307f\u6271\u3046\u5834\u5408\u306f\u4fbf\u5229\u304b\u3082\u3057\u308c\u306a\u3044\u3067\u3059\u304c\u3001<\/p>\n<p>Swift\u3068Kotlin\u305d\u308c\u305e\u308c\u66f8\u3051\u308b\u306e\u306a\u3089\u3070\u3001\u305d\u3061\u3089\u3067\u7ba1\u7406\u3057\u305f\u65b9\u304c\u5f8c\u3005\u306e\u4fdd\u5b88\u6027\u304c\u9ad8\u305d\u3046\u306b\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3044\u304b\u304c\u3067\u3057\u305f\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u307e\u3060\u307e\u3060\u77e5\u3089\u306a\u3044Kotlin\u306e\u4e16\u754c\u3001\u3082\u3063\u3068\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>Java\u306b\u6bd4\u3079\u3066Kotlin\u3092\u6271\u3046\u4eba\u306f\u5c11\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u4e00\u5ea6\u66f8\u3044\u305f\u3089Java\u306b\u623b\u308c\u306a\u3044\u8a00\u8a9e\u3068\u8a00\u308f\u308c\u308b\u307b\u3069\u5feb\u9069\u306a\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n<p>\u305c\u3072\u8a66\u3057\u306b\u66f8\u3044\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>\u5f0a\u793e\u3067\u306fIoT\u306b\u95a2\u9023\u3057\u305f\u3001\u69d8\u3005\u306a\u6848\u4ef6\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4e00\u7dd2\u306b\u3053\u308c\u304b\u3089\u306e\u672a\u6765\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u305b\u3093\u304b\uff1f<\/p>\n<div style=\"margin-bottom: 32px; text-align: center;\"><a style=\"border: solid 1px #1ABB9A; padding: 16px 72px;\" href=\"https:\/\/www.ecomott.co.jp\/recruit\/\" target=\"_blank\" rel=\"noopener\">\u52df\u96c6\u8981\u9805<\/a><\/div>\n<p>\u6700\u5f8c\u307e\u3067\u3054\u89a7\u3044\u305f\u3060\u304d\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30af\u30e9\u30a6\u30c9\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u90e8\u306e\u4eca\u91ce\u3067\u3059\uff01 \u300cAndroid\u30a2\u30d7\u30ea\u3063\u3066Java\u3067\u4f5c\u308c\u3061\u3083\u3046\u304b\u3089Java\u3067\u4f5c\u308d\u3046\u300d \u300cKotlin\u3063\u3066Android\u30a2\u30d7\u30ea\u306b\u3057\u304b\u4f7f\u7528\u3067\u304d\u306a\u3055\u305d\u3046\u300d \u300c \u3042\u30fc\u8a00\u8a9e\u5b66\u7fd2\u306e\u30cf\u30fc\u30c9\u30eb\u9ad8\u305d\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u300d [&hellip;]<\/p>\n","protected":false},"author":116,"featured_media":18226,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[328,31],"_links":{"self":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/18203"}],"collection":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18203"}],"version-history":[{"count":14,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/18203\/revisions"}],"predecessor-version":[{"id":18227,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/18203\/revisions\/18227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/media\/18226"}],"wp:attachment":[{"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}