{"id":1935,"date":"2023-10-05T03:40:39","date_gmt":"2023-10-05T03:40:39","guid":{"rendered":"https:\/\/datmt.com\/?p=1935"},"modified":"2023-10-08T01:23:37","modified_gmt":"2023-10-08T01:23:37","slug":"java-bifunction-tutorial","status":"publish","type":"post","link":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/","title":{"rendered":"Java BiFunction Tutorial"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>In Java, A BiFunction represents a function that accepts two arguments and returns a result. The interface has one abstract method <code>apply<\/code> and one default method <code>andThen<\/code>.<\/p>\n\n\n\n<p>The <code>apply<\/code> method is defined as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}\">R apply(T t, U u);<\/pre><\/div>\n\n\n\n<p>That means it accepts two arguments (t of type T and u of type U) and returns an object of type R.<\/p>\n\n\n\n<p>After reading this post, you will (hopefully) know the following details:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Basic usage of BiFunction<\/li>\n\n\n\n<li>How to use BiFunction in your code<\/li>\n\n\n\n<li>Some practical use cases <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Usage<\/h2>\n\n\n\n<p>Let&#8217;s consider some common operations with BiFunction.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating and calling BiFunction<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}\">    public static void main(String[] args) {\n        \/\/create a BiFunction\n        BiFunction&lt;String, String, String&gt; stringJoiner = (String a, String b) -&gt; a + b;\n       \n        \/\/call the apply method\n        System.out.println(stringJoiner.apply(&quot;Hello &quot;, &quot;World&quot;));\n      \n    }<\/pre><\/div>\n\n\n\n<p>The code above creates a BiFunction called <code>stringJoiner<\/code>. As you can see, the types of the arguments and the return object don&#8217;t need to be different. <\/p>\n\n\n\n<p>Running the code above would provide the following results:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"259\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-2-1024x259.png\" alt=\"Running BiFunction\" class=\"wp-image-1936\" srcset=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-2-1024x259.png 1024w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-2-300x76.png 300w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-2-768x194.png 768w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-2.png 1122w\" \/><\/figure>\n\n\n\n<p>Let&#8217;s try something less boring than just String. As you may know, a male Donkey and a female Horse went to a bar and sometime later, they will produce a Mule. However, if a female Donkey and a male Horse went to a bar, the couple would produce a Hinny!<\/p>\n\n\n\n<p>Let&#8217;s first create some classes to represent the animals:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}\">enum Gender {\n   MALE,\n   FEMALE\n}\nrecord Horse(String name, Gender gender) {\n}\n\nrecord Donkey(String name, Gender gender) {\n\n}\n\ninterface HorseDonkey {\n}\n\nrecord Mule(String name) implements HorseDonkey {\n    @Override\n    public String toString() {\n        return &quot;Mule{&quot; +\n                &quot;name='&quot; + name + '\\'' +\n                '}';\n    }\n}\n\nrecord Hinny(String name) implements HorseDonkey {\n    @Override\n    public String toString() {\n        return &quot;Hinny{&quot; +\n                &quot;name='&quot; + name + '\\'' +\n                '}';\n    }\n}\n<\/pre><\/div>\n\n\n\n<p>And here is the BiFunction<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}\">        BiFunction&lt;Horse, Donkey, HorseDonkey&gt; downtownBar = (Horse horse, Donkey donkey) -&gt; {\n            if (horse.gender() == Gender.FEMALE &amp;&amp; donkey.gender() == Gender.MALE) {\n                return new Mule(horse.name() + &quot;\\uD83D\\uDD25&quot; + donkey.name());\n            } else if (horse.gender() == Gender.MALE &amp;&amp; donkey.gender() == Gender.FEMALE) {\n               return new Hinny(horse.name() + &quot;\\uD83D\\uDD25&quot; + donkey.name());\n            }\n\n            throw new RuntimeException(&quot;Not implemented yet&quot;);\n        };<\/pre><\/div>\n\n\n\n<p>Let&#8217;s try with Jack the male horse and Jane the female Donkey.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}\">    public static void main(String[] args) {\n\n        BiFunction&lt;Horse, Donkey, HorseDonkey&gt; downtownBar = (Horse horse, Donkey donkey) -&gt; {\n            if (horse.gender() == Gender.FEMALE &amp;&amp; donkey.gender() == Gender.MALE) {\n                return new Mule(horse.name() + &quot;\\uD83D\\uDD25&quot; + donkey.name());\n            } else if (horse.gender() == Gender.MALE &amp;&amp; donkey.gender() == Gender.FEMALE) {\n                return new Hinny(horse.name() + &quot;\\uD83D\\uDD25&quot; + donkey.name());\n            }\n\n            throw new RuntimeException(&quot;Not implemented yet&quot;);\n        };\n\n        var jack = new Horse(&quot;Jack&quot;, Gender.MALE);\n        var jane = new Donkey(&quot;Jane&quot;, Gender.FEMALE);\n\n        var horseDonkey = downtownBar.apply(jack, jane);\n\n        System.out.println(horseDonkey);\n    }<\/pre><\/div>\n\n\n\n<p>You can expect that the result is a Hinny:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"310\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-3-1024x310.png\" alt=\"Applying a BiFunction on different object types\" class=\"wp-image-1937\" srcset=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-3-1024x310.png 1024w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-3-300x91.png 300w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-3-768x232.png 768w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-3.png 1124w\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Chaining BiFunction and Function<\/h2>\n\n\n\n<p>Imagine you need to write a function to calculate the shipping fee and tax for an order of many items. The steps are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>First, calculate the total (without shipping and tax)<\/li>\n\n\n\n<li>Next, calculate the total with the shipping<\/li>\n\n\n\n<li>Finally, calculate the tax based on the total with shipping<\/li>\n<\/ol>\n\n\n\n<p>The BiFunction interface has a default method called <code>andThen<\/code> that accepts a Function. You can achieve the above requirements with the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}\">\trecord CartLine(String name, int quantity, double price) {\n\t}\n    public static void main(String[] args) {\n        var cart = List.of(\n                new CartLine(&quot;Apple&quot;, 2, 1.5),\n                new CartLine(&quot;Orange&quot;, 3, 2.0),\n                new CartLine(&quot;Banana&quot;, 1, 3.0)\n        );\n\n        var shippingRate = 0.5;\n        var tax = 0.1;\n\n        BiFunction&lt;Double, Double, Double&gt; shippingBifunction = (total, rate) -&gt; total * (1 + rate);\n        Function&lt;Double, Double&gt; taxFunction = (total) -&gt; total * (1 + tax);\n\n        var cartTotal = cart.stream()\n                .mapToDouble(line -&gt; line.price() * line.quantity())\n                .sum();\n\n        var finalTotal = shippingBifunction.andThen(taxFunction);\n\n        System.out.println(finalTotal.apply(cartTotal, shippingRate));\n    }<\/pre><\/div>\n\n\n\n<p>The <code>andThen<\/code> method returns a BiFunction. That means you can keep calling <code>andThen<\/code> to pass in as many Functions as you need.<\/p>\n\n\n\n<p>Running the code would provide the following result:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"311\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-4-1024x311.png\" alt=\"Chaining BiFunction with Function\" class=\"wp-image-1938\" srcset=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-4-1024x311.png 1024w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-4-300x91.png 300w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-4-768x233.png 768w, https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/image-4.png 1126w\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In this post, I&#8217;ve shown you the basic usages of the BiFunction functional interface in Java. To use this interface, you need to provide the implementation for the apply method. You can also use the <code>andThen<\/code> method to chain subsequent functions to further process the result. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview In Java, A BiFunction represents a function that accepts two arguments and returns a result. The interface has one abstract method apply and one default method andThen. The apply method is defined as follows: That means it accepts two arguments (t of type T and u of type U) and returns an object of &#8230; <a title=\"Java BiFunction Tutorial\" class=\"read-more\" href=\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\" aria-label=\"Read more about Java BiFunction Tutorial\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1974,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1,4],"tags":[],"class_list":["post-1935","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backend","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java BiFunction Tutorial - datmt<\/title>\n<meta name=\"description\" content=\"Unlock the Power of Java BiFunction: Dive into our comprehensive tutorial, packed with examples and practical insights. Learn how to harness the versatility of BiFunction for efficient data processing in Java. Master essential techniques and elevate your Java programming skills today!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java BiFunction Tutorial - datmt\" \/>\n<meta property=\"og:description\" content=\"Unlock the Power of Java BiFunction: Dive into our comprehensive tutorial, packed with examples and practical insights. Learn how to harness the versatility of BiFunction for efficient data processing in Java. Master essential techniques and elevate your Java programming skills today!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"datmt\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-05T03:40:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-08T01:23:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u0110\u1ea1t Tr\u1ea7n\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0110\u1ea1t Tr\u1ea7n\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\"},\"author\":{\"name\":\"\u0110\u1ea1t Tr\u1ea7n\",\"@id\":\"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e\"},\"headline\":\"Java BiFunction Tutorial\",\"datePublished\":\"2023-10-05T03:40:39+00:00\",\"dateModified\":\"2023-10-08T01:23:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\"},\"wordCount\":369,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e\"},\"image\":{\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg\",\"articleSection\":[\"backend\",\"java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\",\"url\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\",\"name\":\"Java BiFunction Tutorial - datmt\",\"isPartOf\":{\"@id\":\"https:\/\/datmt.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg\",\"datePublished\":\"2023-10-05T03:40:39+00:00\",\"dateModified\":\"2023-10-08T01:23:37+00:00\",\"description\":\"Unlock the Power of Java BiFunction: Dive into our comprehensive tutorial, packed with examples and practical insights. Learn how to harness the versatility of BiFunction for efficient data processing in Java. Master essential techniques and elevate your Java programming skills today!\",\"breadcrumb\":{\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage\",\"url\":\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg\",\"contentUrl\":\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/datmt.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java BiFunction Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/datmt.com\/#website\",\"url\":\"https:\/\/datmt.com\/\",\"name\":\"datmt\",\"description\":\"Hands on projects\",\"publisher\":{\"@id\":\"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/datmt.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e\",\"name\":\"\u0110\u1ea1t Tr\u1ea7n\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/datmt.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/03\/cropped-profile.jpg\",\"contentUrl\":\"https:\/\/datmt.com\/wp-content\/uploads\/2023\/03\/cropped-profile.jpg\",\"width\":512,\"height\":512,\"caption\":\"\u0110\u1ea1t Tr\u1ea7n\"},\"logo\":{\"@id\":\"https:\/\/datmt.com\/#\/schema\/person\/image\/\"},\"description\":\"I build softwares that solve problems. I also love writing\/documenting things I learn\/want to learn.\",\"sameAs\":[\"https:\/\/datmt.com\"],\"url\":\"https:\/\/datmt.com\/author\/mtdat171_c\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java BiFunction Tutorial - datmt","description":"Unlock the Power of Java BiFunction: Dive into our comprehensive tutorial, packed with examples and practical insights. Learn how to harness the versatility of BiFunction for efficient data processing in Java. Master essential techniques and elevate your Java programming skills today!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Java BiFunction Tutorial - datmt","og_description":"Unlock the Power of Java BiFunction: Dive into our comprehensive tutorial, packed with examples and practical insights. Learn how to harness the versatility of BiFunction for efficient data processing in Java. Master essential techniques and elevate your Java programming skills today!","og_url":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/","og_site_name":"datmt","article_published_time":"2023-10-05T03:40:39+00:00","article_modified_time":"2023-10-08T01:23:37+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg","type":"image\/jpeg"}],"author":"\u0110\u1ea1t Tr\u1ea7n","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u0110\u1ea1t Tr\u1ea7n","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#article","isPartOf":{"@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/"},"author":{"name":"\u0110\u1ea1t Tr\u1ea7n","@id":"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e"},"headline":"Java BiFunction Tutorial","datePublished":"2023-10-05T03:40:39+00:00","dateModified":"2023-10-08T01:23:37+00:00","mainEntityOfPage":{"@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/"},"wordCount":369,"commentCount":0,"publisher":{"@id":"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e"},"image":{"@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg","articleSection":["backend","java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/","url":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/","name":"Java BiFunction Tutorial - datmt","isPartOf":{"@id":"https:\/\/datmt.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg","datePublished":"2023-10-05T03:40:39+00:00","dateModified":"2023-10-08T01:23:37+00:00","description":"Unlock the Power of Java BiFunction: Dive into our comprehensive tutorial, packed with examples and practical insights. Learn how to harness the versatility of BiFunction for efficient data processing in Java. Master essential techniques and elevate your Java programming skills today!","breadcrumb":{"@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#primaryimage","url":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg","contentUrl":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/10\/datmt-java-thumbnail.jpg-bc-at-1935.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/datmt.com\/backend\/java\/java-bifunction-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datmt.com\/"},{"@type":"ListItem","position":2,"name":"Java BiFunction Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/datmt.com\/#website","url":"https:\/\/datmt.com\/","name":"datmt","description":"Hands on projects","publisher":{"@id":"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/datmt.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/datmt.com\/#\/schema\/person\/7736566e3758f424a11fd53f581c4b5e","name":"\u0110\u1ea1t Tr\u1ea7n","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datmt.com\/#\/schema\/person\/image\/","url":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/03\/cropped-profile.jpg","contentUrl":"https:\/\/datmt.com\/wp-content\/uploads\/2023\/03\/cropped-profile.jpg","width":512,"height":512,"caption":"\u0110\u1ea1t Tr\u1ea7n"},"logo":{"@id":"https:\/\/datmt.com\/#\/schema\/person\/image\/"},"description":"I build softwares that solve problems. I also love writing\/documenting things I learn\/want to learn.","sameAs":["https:\/\/datmt.com"],"url":"https:\/\/datmt.com\/author\/mtdat171_c\/"}]}},"_links":{"self":[{"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/posts\/1935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/comments?post=1935"}],"version-history":[{"count":1,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/posts\/1935\/revisions"}],"predecessor-version":[{"id":1940,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/posts\/1935\/revisions\/1940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/media\/1974"}],"wp:attachment":[{"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/media?parent=1935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/categories?post=1935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datmt.com\/wp-json\/wp\/v2\/tags?post=1935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}