{"id":79062,"date":"2020-06-13T09:00:34","date_gmt":"2020-06-13T03:30:34","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=79062"},"modified":"2020-06-13T09:00:34","modified_gmt":"2020-06-13T03:30:34","slug":"merge-two-arrays-in-java","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/","title":{"rendered":"How to Merge Two Arrays in Java"},"content":{"rendered":"<p>We hope you are enjoying reading our Java articles and are learning Java in an interesting way. In this article, we have come with a new tutorial that will teach you about merging two arrays in Java.<\/p>\n<p>We must say that you are all now very familiar and comfortable with arrays in Java as we covered the concept of arrays in many articles.<\/p>\n<p>In this article, we will learn how we can merge two different arrays in Java and form a resulting array without changing the sequence of its elements.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/06\/Merging-two-arrays-in-java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79064\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/06\/Merging-two-arrays-in-java.jpg\" alt=\"Merge two arrays in java\" width=\"802\" height=\"420\" \/><\/a><\/p>\n<h3>Merge two Arrays in Java<\/h3>\n<p>We know that an array is a contiguous memory location of elements that are of the same datatype. We can perform several operations on a single array but merging two arrays involves two different arrays.<\/p>\n<p>Merging means concatenating elements of two arrays into a single array. The elements of the first array precede the elements of the second array.<\/p>\n<p><strong>For example:<\/strong><\/p>\n<p>Suppose there are three arrays named <strong>array1, array2 and array3<\/strong>. We will merge array1 and array2 into array3 as follows:<\/p>\n<p><strong>int array1[ ] = { 1, 2, 3, 4, 5 };\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ first array<\/strong><br \/>\n<strong>int array2[ ] = { 6, 7, 8, 9, 10 };\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/second array<\/strong><br \/>\n<strong>int array3[ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/third array(resultant array)<\/strong><\/p>\n<p>We can do this by manual method of combining two arrays or we can also use some predefined methods and libraries to accomplish this task. There are many ways to merge two arrays in Java.<\/p>\n<p>Let\u2019s discuss each of them with implementation.<\/p>\n<h3>Different Ways to Merge Arrays in Java<\/h3>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/06\/Different-ways-to-Merge-two-arrays-in-java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79065\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/06\/Different-ways-to-Merge-two-arrays-in-java.jpg\" alt=\"Different ways to Merge two arrays in java\" width=\"470\" height=\"640\" \/><\/a><\/p>\n<p>Following are some different ways that we can use to merge two arrays in Java:<\/p>\n<p>1. Using <strong>Conventional\/manual<\/strong> method<br \/>\n2. Using<strong> arraycopy()<\/strong> method of Java<br \/>\n3. Using <strong>Java Collections<\/strong><br \/>\n4. Using<strong> Java Stream API<\/strong><br \/>\n5. Using <strong>ObjectArrays<\/strong> class of Guava library<\/p>\n<h4>1. Manual Method in Java<\/h4>\n<p>In this method, we do not use any predefined method for merging two arrays. We just take one array and then the second array. Then, we calculate the lengths of both the arrays and add the lengths.<\/p>\n<p>We create a new array with the length as the sum of lengths of these two arrays. Now we just start adding the elements of each array in the resulting array. As a result of this method, we get a resulting array as the concatenation of two arrays.<\/p>\n<p>Let\u2019s see the code to understand this method:<\/p>\n<p><strong>Code to understand the manual method of merging two arrays in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.mergearrays;\nimport java.util.Arrays;\npublic class ManualMethod {\n  public static void main(String[] args) {\n    \/\/declaring two character arrays\n    int[] array1 = {\n      1,\n      2,\n      3,\n      4\n    };\n    int[] array2 = {\n      5,\n      6,\n      7,\n      8\n    };\n\n    \/\/Calculating sum of length of two arrays\n    int length = array1.length + array2.length;\n\n    System.out.println(\"First Array is: \");\n    for (int i = 0; i &lt; array1.length; i++) {\n      System.out.print(\" \" + array1[i]);\n    }\n    System.out.println(\" \");\n\n    System.out.println(\"Second Array is: \");\n    for (int i = 0; i &lt; array2.length; i++) {\n      System.out.print(\" \" + array2[i]);\n    }\n\n    \/\/Creating a resulting array of the calculated length\n    int[] result = new int[length];\n    int position = 0;\n\n    \/\/for each loop to add array1 elements to the resulting array\n    for (int element: array1) {\n      result[position] = element;\n      position++;\n    }\n\n    \/\/for each loop to add array2 elements to the resulting array\n    for (int element: array2) {\n      result[position] = element;\n      position++;\n    }\n\n    System.out.println(\"\\nThe resulting array after merging two arrays is: \");\n    System.out.println(Arrays.toString(result));\n  }\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">First Array is:<br \/>\n1 2 3 4<br \/>\nSecond Array is:<br \/>\n5 6 7 8<br \/>\nThe resulting array after merging two arrays is:<br \/>\n[1, 2, 3, 4, 5, 6, 7, 8]<\/div>\n<h4>2. arraycopy() Method in Java<\/h4>\n<p>Java arraycopy() is the method of the System class which belongs to the java.lang package. It copies an array from the specified source array to the specified position of the destination array.<\/p>\n<p>The number of elements copied is equal to the length argument.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p><strong>public static void arraycopy(Object source, int source_position, Object destination, int destination_position, int length)<\/strong><\/p>\n<p><strong>Parameters of arraycopy() method:<\/strong><\/p>\n<ul>\n<li><strong>source:<\/strong> It is a source array.<\/li>\n<li><strong>source_position:<\/strong> Starting point in the source array.<\/li>\n<li><strong>destination:<\/strong> It is a destination array.<\/li>\n<li><strong>destination_position:<\/strong> Starting position in the destination array.<\/li>\n<li><strong>length:<\/strong> The number of array elements to be copied<\/li>\n<\/ul>\n<p><strong>Example of arraycopy() method:<\/strong><\/p>\n<p>In the following example, we have created two integer arrays array1 and array2. To merge two arrays, firstly we find the length of each array. We store the length of array1 in length1 variable and length of array2 in length2 variable.<\/p>\n<p>After that, we create a new integer array result which stores the sum of length of both arrays. Now, we copy each element of both arrays to the result array by using the arraycopy() method.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.mergearrays;\nimport java.util.Arrays;\npublic class ArrayCopyMethod {\n  public static void main(String[] args) {\n    int[] array1 = {\n      1,\n      2,\n      3,\n      4\n    };\n    int[] array2 = {\n      5,\n      6,\n      7,\n      8\n    };\n\n    System.out.println(\"First Array is: \");\n    for (int i = 0; i &lt; array1.length; i++) {\n      System.out.print(\" \" + array1[i]);\n    }\n    System.out.println(\" \");\n\n    System.out.println(\"Second Array is: \");\n    for (int i = 0; i &lt; array2.length; i++) {\n      System.out.print(\" \" + array2[i]);\n    }\n    \/\/Calculating length of each array\n    int length1 = array1.length;\n    int length2 = array2.length;\n    int[] result = new int[length1 + length2];\n\n    \/\/Using arraycopy method to merge two arrays\n    System.arraycopy(array1, 0, result, 0, length1);\n    System.arraycopy(array2, 0, result, length1, length2);\n\n    System.out.println(\"\\nThe resulting array after merging two arrays is: \");\n    System.out.println(Arrays.toString(result));\n  }\n}\n\nOutput: First Array is: 1 2 3 4\nSecond Array is: 5 6 7 8\nThe resulting array after merging two arrays is: [1, 2, 3, 4, 5, 6, 7, 8]<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">First Array is:<br \/>\n1 2 3 4<br \/>\nSecond Array is:<br \/>\n5 6 7 8<br \/>\nThe resulting array after merging two arrays is:<br \/>\n[1, 2, 3, 4, 5, 6, 7, 8]<\/div>\n<h4>3. Using Java Collections<\/h4>\n<p>We know that a Collection in Java is a group of different objects collected into a single unit. The Collection framework in Java contains many classes and interfaces to group many objects into a single unit.<\/p>\n<p>So, we can also use them to merge two arrays into a single array.<\/p>\n<p><strong>Code to merge two arrays using Collections in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.mergearrays;\nimport java.util. * ;\npublic class MergeArrayExample4 {\n  public static void main(String args[]) {\n    String str1[] = {\n      \"T\",\n      \"E\",\n      \"C\",\n      \"H\"\n    }; \/\/source array  \n    String str2[] = {\n      \"V\",\n      \"I\",\n      \"D\",\n      \"V\",\n      \"A\",\n      \"N\"\n    }; \/\/destination array  \n    System.out.print(\"The first array is:\");\n    for (int i = 0; i &lt; str1.length; i++) {\n      System.out.print(\" \" + str1[i]);\n    }\n    System.out.print(\"\\nThe second array is:\");\n    for (int i = 0; i &lt; str2.length; i++) {\n      System.out.print(\" \" + str2[i]);\n    }\n    \/\/returns a list view of an array  \n    List list = new ArrayList(Arrays.asList(str1));\n\n    \/\/returns a list view of str2 and adds all elements of str2 into list  \n    list.addAll(Arrays.asList(str2));\n\n    \/\/converting list to array  \n    Object[] str3 = list.toArray();\n    System.out.print(\"\\nThe merged array is: \");\n    System.out.println(Arrays.toString(str3));\n    \/\/prints the resultant array  \n  }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">The first array is: T E C H<br \/>\nThe second array is: V I D V A N<br \/>\nThe merged array is: [T, E, C, H, V, I, D, V, A, N]<\/div>\n<h4>4. Java Stream API<\/h4>\n<p>If you have Java 8 installed in your system, then you can use this feature to merge two arrays. The Stream API(Application Programming Interface) provides many methods that are used to merge two arrays in Java.<\/p>\n<p>This API is present in the java.util.stream package of Java. It also makes use of collections but using Stream API you can work with collections in Java 8 to merge 2 arrays.<\/p>\n<p><strong>Code to understand the Java Collection for Java 8 Stream Of merging two arrays in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.mergearrays;\nimport java.util. * ;\nimport java.util.stream.Stream;\nimport java.util.Arrays;\nimport java.io. * ;\n\npublic class StreamDemo {\n  \/\/ To merge our two arrays we declare the following Function.\n  public static &lt; Merge &gt; Object[] merging(Merge[] array1, Merge[] array2) {\n    \/\/ Creating a List of type Object for merge our two arrays \n    List &lt; Object &gt; array3 = new ArrayList &lt; &gt;();\n\n    \/\/ Adding the array one-by-one into the list\n    Stream.of(array1, array2).flatMap(Stream::of).forEach(array3::add);\n\n    \/\/ Converting the list to array and returning the array to the main method \n    return array3.toArray();\n  }\n\n  public static void main(String[] args) {\n    \/\/ Declaring an array that we have to merge\n    Integer[] array1 = new Integer[] {\n      1,\n      2,\n      3,\n      4,\n      5\n    };\n\n    \/\/ Declaring another array that we have to merge\n    Integer[] array2 = new Integer[] {\n      6,\n      7,\n      8,\n      9,\n      10\n    };\n\n    \/\/ creating object to call the merge method\n    Object[] array3 = merging(array1, array2);\n\n    System.out.println(\"Merged array after merging our two array: \" + Arrays.toString(array3));\n  }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Merged array after merging our two array: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<\/div>\n<h3>5. Using Guava Library in Java<\/h3>\n<p>The Guava library of Java contains an ObjectArrays class that contains a <a href=\"http:\/\/ctat.pact.cs.cmu.edu\/docs\/functions\/index.html?edu\/cmu\/pact\/BehaviorRecorder\/ProblemModel\/Matcher\/Functions\/concat.html\">concat()<\/a> method to merge two arrays and returns the concatenated contents of two arrays.<\/p>\n<p><strong>3 Parameters of Java concat() method:<\/strong><\/p>\n<ul>\n<li><strong>first &#8211;<\/strong> the first array of elements to concatenate<\/li>\n<li><strong>second &#8211;<\/strong> the second array of elements to concatenate<\/li>\n<li><strong>type &#8211;<\/strong> the component type of the returned array<\/li>\n<\/ul>\n<p><strong>Code snippet to understand concat() method:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/\/ Function to merge two arrays in Java\npublic static String[] concatenate(String[] first, String[] second) {\n  return ObjectArrays.concat(first, second, String.class);\n}<\/pre>\n<h3>Conclusion<\/h3>\n<p>In this article, we learned how to merge two arrays in Java. Merging two arrays means concatenating elements of two arrays into a single array.<\/p>\n<p>There may be many situations when you need to merge two arrays and perform the operations on the resulting merged array, in this article, we discussed each way of merging two arrays in Java with examples.<\/p>\n<p>You can use any of them according to your comfort.<\/p>\n<p><strong>To master Java, stay with TechVidvan!!!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We hope you are enjoying reading our Java articles and are learning Java in an interesting way. In this article, we have come with a new tutorial that will teach you about merging two&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":79064,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[2843,2844,2845],"class_list":["post-79062","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-arrays-merging-in-java","tag-concatenate-java-arrays","tag-merge-two-arrays-in-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Merge Two Arrays in Java - TechVidvan<\/title>\n<meta name=\"description\" content=\"How to merge two arrays in java using methods ie. Conventional method, arraycopy(), Java Collections,Java Stream API,ObjectArrays class of Guava library\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Merge Two Arrays in Java - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"How to merge two arrays in java using methods ie. Conventional method, arraycopy(), Java Collections,Java Stream API,ObjectArrays class of Guava library\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-13T03:30:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Merging-two-arrays-in-java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Merge Two Arrays in Java - TechVidvan","description":"How to merge two arrays in java using methods ie. Conventional method, arraycopy(), Java Collections,Java Stream API,ObjectArrays class of Guava library","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:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/","og_locale":"en_US","og_type":"article","og_title":"How to Merge Two Arrays in Java - TechVidvan","og_description":"How to merge two arrays in java using methods ie. Conventional method, arraycopy(), Java Collections,Java Stream API,ObjectArrays class of Guava library","og_url":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-06-13T03:30:34+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Merging-two-arrays-in-java.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"How to Merge Two Arrays in Java","datePublished":"2020-06-13T03:30:34+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/"},"wordCount":946,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Merging-two-arrays-in-java.jpg","keywords":["Arrays merging in java","Concatenate java arrays","Merge Two Arrays in Java"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/","url":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/","name":"How to Merge Two Arrays in Java - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Merging-two-arrays-in-java.jpg","datePublished":"2020-06-13T03:30:34+00:00","description":"How to merge two arrays in java using methods ie. Conventional method, arraycopy(), Java Collections,Java Stream API,ObjectArrays class of Guava library","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Merging-two-arrays-in-java.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Merging-two-arrays-in-java.jpg","width":802,"height":420,"caption":"Merge two arrays in java"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/merge-two-arrays-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to Merge Two Arrays in Java"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=79062"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79062\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/79064"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=79062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=79062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=79062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}