{"id":28,"date":"2008-12-31T14:48:00","date_gmt":"2008-12-31T12:48:00","guid":{"rendered":"https:\/\/blog.lifshitz.net\/java-language-change"},"modified":"2014-11-17T16:09:05","modified_gmt":"2014-11-17T14:09:05","slug":"java-language-change","status":"publish","type":"post","link":"https:\/\/blog.lifshitz.net\/?p=28","title":{"rendered":"Java Language Change"},"content":{"rendered":"<p>I&#8217;ve been to <a href=\"http:\/\/www.javaedge.net\/\">JavaEdge 2008<\/a> last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.<\/p>\n<p>During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.<\/p>\n<p>Here is the list of proposed changes, and even if you don&#8217;t get to vote, I think it&#8217;s interesting and thought provoking:<\/p>\n<p><strong>1. Map-for-each:<\/strong><\/p>\n<pre><code><br \/>for <a style=\"color:red\">(String key, Integer value : map)<\/a> {<br \/>...<br \/>}<br \/><\/code><\/pre>\n<p><strong>2. For-each iteration control:<\/strong><\/p>\n<pre><code>for (String str : list <a style=\"color:red\">: it<\/a>) {<br \/>\tif (str.length() > 100) {<br \/>\t   \t<a style=\"color:red\">it.remove();<br \/>\t}<br \/>\tit.set(...);<br \/>\tit.index();<br \/>\tit.isFirst();<br \/>\tit.isLast();<br \/>\t<\/a><br \/>}<br \/><\/code><\/pre>\n<p><strong>3. List\/map access:<\/strong><\/p>\n<pre><code><br \/>List&lt;String&gt; list = ...<br \/>Map&lt;String, Job&gt; map = ...<br \/>Map&lt;String, Map&lt;String, Task&gt;&gt; combined = ...<br \/><br \/>String str = list<a style=\"color:red\">[0]<\/a>;<br \/>list<a style=\"color:red\">[0]<\/a> = \"Hi\";<br \/>Integer value = map<a style=\"color:red\">[str]<\/a>;<br \/>map<a style=\"color:red\">[\"Hi\"]<\/a> = 56;<br \/>Task task = combined<a style=\"color:red\">[\"Test\"][\"Monitor\"]<\/a>;<br \/><\/code><\/pre>\n<p><strong>4. Infer generics in declarations:<\/strong><\/p>\n<pre>Instead of<br \/><code>List&lt;String&gt; list = new ArrayList&ltString&gt;();<br \/><\/code>use<code><br \/>List&lt;String&gt; list = new ArrayList<a style=\"color:red\">&lt;&gt;<\/a>();<br \/><\/code><\/pre>\n<p><strong>5. Multi-catch of Exceptions:<\/strong><\/p>\n<pre><code><br \/>try {<br \/>\tdoSomething();<br \/>\tdoSomethingElse();<br \/>}<br \/>catch (IOException<a style=\"color:red\">, SQLException ex<\/a>) {<br \/>\/\/ handle..<br \/>}<br \/><\/code><\/pre>\n<p><strong>6. String switch:<\/strong><\/p>\n<pre><br \/><code><br \/>String str = ..<br \/><a style=\"color:red\">switch (str)<\/a> {<br \/>\t<a style=\"color:red\">case \"name\"<\/a>:<br \/>\t\tprocessName();<br \/>\t\tbreak;<br \/>\t<a style=\"color:red\">case \"surname\"<\/a>:<br \/>\t\tprocessSurname;<br \/>...<br \/>}<\/code><\/pre>\n<p><strong>7. String interpolation:<\/strong><\/p>\n<pre><code><br \/>String name = ...<br \/>String Value = ..<br \/>String out = <a style=\"color:red\">$<\/a>\"The value of <a style=\"color:red\">${name}<\/a> is <a style=\"color:red\">${value}<\/a>\";<\/code><\/pre>\n<p><strong>8. Multi-line Strings<\/strong><\/p>\n<pre><code><br \/>String sql = <br \/><a style=\"color:red\">\"\"\"<\/a>SELECT firstname, lastname, birth_date,<br \/>\ttelephone, account<br \/>\tFROM <br \/>\tpreson, phone, email<br \/>\tWHERE <br \/>\t..<br \/>\t\"\"\";<\/code><\/pre>\n<p><strong>9. Resource management:<\/strong><\/p>\n<pre><br \/><code><br \/>try <a style=\"color:red\">(FileReader in = new FileReader(file))<\/a> {<br \/>\tprocessFile(in);<br \/>} \/\/ and resource validation and release is done automatically<br \/><\/code><\/pre>\n<p><strong>10. Null-handling:<\/strong><\/p>\n<pre><br \/><code><br \/>Session sess = ..<br \/><br \/>String code = sess<a style=\"color:red\">?<\/a>.preson()<a style=\"color:red\">?<\/a>.address()<a style=\"color:red\">?<\/a>.postcode(); \/\/ if anything preceding ? is null, the result is null<br \/><\/code><br \/><\/pre>\n<p>What&#8217;s your vote? \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing. During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously)&hellip;&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[9,20,21],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-change","category-java","category-language"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"I&#039;ve been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gadi\"\/>\n\t<meta name=\"google-site-verification\" content=\"DLlL0GJbP_qA1d7KlqKLvBJERDeissAuIEvTqeYz5O8\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/blog.lifshitz.net\/?p=28\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gadi&#039;s Blog - A blog about technology, management, and stuff...\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Java Language Change - Gadi&#039;s Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"I&#039;ve been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/blog.lifshitz.net\/?p=28\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2008-12-31T12:48:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2014-11-17T14:09:05+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Java Language Change - Gadi&#039;s Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I&#039;ve been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#blogposting\",\"name\":\"Java Language Change - Gadi's Blog\",\"headline\":\"Java Language Change\",\"author\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#organization\"},\"datePublished\":\"2008-12-31T14:48:00+02:00\",\"dateModified\":\"2014-11-17T16:09:05+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#webpage\"},\"articleSection\":\"change, java, language\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.lifshitz.net\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=9#listItem\",\"name\":\"change\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=9#listItem\",\"position\":2,\"name\":\"change\",\"item\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=9\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#listItem\",\"name\":\"Java Language Change\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#listItem\",\"position\":3,\"name\":\"Java Language Change\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=9#listItem\",\"name\":\"change\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#organization\",\"name\":\"Gadi's Blog\",\"description\":\"A blog about technology, management, and stuff...\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1\",\"name\":\"gadi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57df3a2c5d92d221b0ac065f950d678df7002a3732bf62736d06621b8d7635df?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"gadi\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#webpage\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28\",\"name\":\"Java Language Change - Gadi's Blog\",\"description\":\"I've been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=28#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\"},\"datePublished\":\"2008-12-31T14:48:00+02:00\",\"dateModified\":\"2014-11-17T16:09:05+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#website\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/\",\"name\":\"Gadi's Blog\",\"description\":\"A blog about technology, management, and stuff...\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Java Language Change - Gadi's Blog","description":"I've been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here","canonical_url":"https:\/\/blog.lifshitz.net\/?p=28","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"DLlL0GJbP_qA1d7KlqKLvBJERDeissAuIEvTqeYz5O8","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/blog.lifshitz.net\/?p=28#blogposting","name":"Java Language Change - Gadi's Blog","headline":"Java Language Change","author":{"@id":"https:\/\/blog.lifshitz.net\/?author=1#author"},"publisher":{"@id":"https:\/\/blog.lifshitz.net\/#organization"},"datePublished":"2008-12-31T14:48:00+02:00","dateModified":"2014-11-17T16:09:05+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/blog.lifshitz.net\/?p=28#webpage"},"isPartOf":{"@id":"https:\/\/blog.lifshitz.net\/?p=28#webpage"},"articleSection":"change, java, language"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.lifshitz.net\/?p=28#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net#listItem","position":1,"name":"Home","item":"https:\/\/blog.lifshitz.net","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?cat=9#listItem","name":"change"}},{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?cat=9#listItem","position":2,"name":"change","item":"https:\/\/blog.lifshitz.net\/?cat=9","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?p=28#listItem","name":"Java Language Change"},"previousItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?p=28#listItem","position":3,"name":"Java Language Change","previousItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?cat=9#listItem","name":"change"}}]},{"@type":"Organization","@id":"https:\/\/blog.lifshitz.net\/#organization","name":"Gadi's Blog","description":"A blog about technology, management, and stuff...","url":"https:\/\/blog.lifshitz.net\/"},{"@type":"Person","@id":"https:\/\/blog.lifshitz.net\/?author=1#author","url":"https:\/\/blog.lifshitz.net\/?author=1","name":"gadi","image":{"@type":"ImageObject","@id":"https:\/\/blog.lifshitz.net\/?p=28#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/57df3a2c5d92d221b0ac065f950d678df7002a3732bf62736d06621b8d7635df?s=96&d=retro&r=g","width":96,"height":96,"caption":"gadi"}},{"@type":"WebPage","@id":"https:\/\/blog.lifshitz.net\/?p=28#webpage","url":"https:\/\/blog.lifshitz.net\/?p=28","name":"Java Language Change - Gadi's Blog","description":"I've been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/blog.lifshitz.net\/#website"},"breadcrumb":{"@id":"https:\/\/blog.lifshitz.net\/?p=28#breadcrumblist"},"author":{"@id":"https:\/\/blog.lifshitz.net\/?author=1#author"},"creator":{"@id":"https:\/\/blog.lifshitz.net\/?author=1#author"},"datePublished":"2008-12-31T14:48:00+02:00","dateModified":"2014-11-17T16:09:05+02:00"},{"@type":"WebSite","@id":"https:\/\/blog.lifshitz.net\/#website","url":"https:\/\/blog.lifshitz.net\/","name":"Gadi's Blog","description":"A blog about technology, management, and stuff...","inLanguage":"en-US","publisher":{"@id":"https:\/\/blog.lifshitz.net\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gadi's Blog - A blog about technology, management, and stuff...","og:type":"article","og:title":"Java Language Change - Gadi's Blog","og:description":"I've been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here","og:url":"https:\/\/blog.lifshitz.net\/?p=28","article:published_time":"2008-12-31T12:48:00+00:00","article:modified_time":"2014-11-17T14:09:05+00:00","twitter:card":"summary_large_image","twitter:title":"Java Language Change - Gadi's Blog","twitter:description":"I've been to JavaEdge 2008 last week, and while many of the sessions were interesting, I found the one about the Java Language Change particularly intriguing.During the session 10 proposed changes were introduced, all of them minor by definition (as stated by Sun in the JavaOne 2008 TS-5881 presentation), and everyone got to (anonymously) vote.Here"},"aioseo_meta_data":{"post_id":"28","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-07-21 07:49:45","updated":"2026-07-21 07:49:45"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.lifshitz.net\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.lifshitz.net\/?cat=9\" title=\"change\">change<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tJava Language Change\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/blog.lifshitz.net"},{"label":"change","link":"https:\/\/blog.lifshitz.net\/?cat=9"},{"label":"Java Language Change","link":"https:\/\/blog.lifshitz.net\/?p=28"}],"_links":{"self":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":0,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}