{"id":78936,"date":"2020-06-04T10:00:36","date_gmt":"2020-06-04T04:30:36","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=78936"},"modified":"2020-06-04T10:00:36","modified_gmt":"2020-06-04T04:30:36","slug":"java-constructor-chaining","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/","title":{"rendered":"Java Constructor Chaining Example and Implementation"},"content":{"rendered":"<p><span style=\"font-weight: 400\">In our previous article, we discussed what is a Constructor and Copy Constructor in Java. In this article, we will discuss Constructor Chaining in Java. <\/span><\/p>\n<p><b>Constructor Chaining <\/b><span style=\"font-weight: 400\">is the process of invoking one constructor from another constructor. It is very tricky to understand how to call a constructor from another constructor. <\/span><\/p>\n<p><span style=\"font-weight: 400\">We can implement the Constructor Chaining in Java using either <\/span><b>this <\/b><span style=\"font-weight: 400\">keyword or the <\/span><b>super <\/b><span style=\"font-weight: 400\">keyword. Let\u2019s start learning Constructor Chaining in Java.<\/span><\/p>\n<h3><strong>What is Constructor Chaining in Java?<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">Constructor Chaining is the process of calling one constructor of a class from another constructor of the same class or another class using the current object of the class.\u00a0<\/span><\/p>\n<h3><b>Ways to implement Java Constructor Chaining<\/b><\/h3>\n<p><span style=\"font-weight: 400\">There are two ways by which we can use constructor chaining in Java. These ways depend on whether we are using it in the same class or the different class.<\/span><\/p>\n<ul>\n<li><b><span style=\"font-weight: 400\">Using <\/span>this<span style=\"font-weight: 400\"> keyword<\/span><\/b><\/li>\n<li><b><span style=\"font-weight: 400\">Using the <\/span>super<span style=\"font-weight: 400\"> keyword<\/span><\/b><\/li>\n<\/ul>\n<h4><strong>a. Constructor Chaining with this() keyword<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">If we want to call the constructor from the <\/span><b>same<\/b><span style=\"font-weight: 400\"> class, then we use<\/span><b> this<\/b><span style=\"font-weight: 400\"> keyword. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Suppose we want to call both default and parameterized constructor during the instantiation of the class, then we pass the parameter at the object creation and in that parameterized constructor, we will write <\/span><b>this<\/b><span style=\"font-weight: 400\"> statement so that the default constructor will be called. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Let\u2019s see an example to understand this:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.constructorchaining;\nclass Example {\n  \/\/default constructor\n  Example() {\n    System.out.println(\"Inside Default\");\n  }\n  \/\/Parameterized constructor\n  Example(int n) {\n    \/\/calling default constructor\n    this();\n    System.out.println(\"Inside Parameterized\");\n  }\n}\npublic class ThisExample {\n  public static void main(String arg[]) {\n    \/\/calling the parameterized constructor\n    Example obj = new Example(15);\n  }\n}<\/pre>\n<p><b>Output:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Inside Default<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside Parameterized<\/span><\/p>\n<h4><strong>b. Constructor Chaining with super() keyword<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">If we want to call the constructor from the <\/span><b>parent<\/b><span style=\"font-weight: 400\"> class, then we use the <\/span><b>super<\/b><span style=\"font-weight: 400\"> keyword. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Thus when there is more than one class with the relationship of inheritance, we need to use the super keyword in the child class to call the constructor of the parent class.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> We can call a constructor of the current class only with this(). For example:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.constructorchaining;\nclass Parent {\n  Parent() {\n    System.out.println(\"Parent class default constructor\");\n  }\n  Parent(int x) {\n    System.out.println(\"Parent class one-argument constructor\");\n  }\n}\nclass Child extends Parent {\n  Child() {\n    \/\/by default the default constructor of Parent class is invoked\n    System.out.println(\"Child class default constructor\");\n  }\n  Child(int x) {\n    super(); \/\/ default constructor of Parent class is invoked\n    System.out.println(\"Child class one-argument constructor\");\n  }\n}\npublic class SuperExample {\n  public static void main(String arg[]) {\n    Child obj1 = new Child();\n    Child obj2 = new Child(10);\n  }\n}<\/pre>\n<p><b>Output:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Parent class default constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">Child class default constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">Parent class default constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">Child class one-argument constructor<\/span><\/p>\n<h3><strong>Need for Constructor Chaining in Java<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">Constructor Chaining in Java is used when we want to pass parameters through multiple different constructors using a single object.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> Using constructor chaining, we can perform multiple tasks through a single constructor instead of writing each task in a single constructor. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Constructor chaining allows us to create a separate constructor for each task and make links or chains among them, so as to increase the readability of the code.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Suppose, If we do not perform chaining among constructors and they require a specific parameter, then we will need to initialize that parameter twice in each constructor. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Whenever you want to make changes in the parameter you will have to make changes inside each constructor.<\/span><\/p>\n<p><b><i>Note: <\/i><\/b><i><span style=\"font-weight: 400\">In Java, it is invalid and illegal to call the constructor directly by name. We have to use either of these two keywords to call a constructor.<\/span><\/i><\/p>\n<h3><strong>Working of Constructor Chaining in Java<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">Constructor chaining happens with the process of Inheritance in Java. When we are dealing with the parent class constructor, then the constructor of the subclass will first call the constructor of the superclass.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> This makes sure that the subclass is created with the initialization of the members of the parent class. The constructor chain continues until it reaches the constructor with the last chain.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> But, we can not call more than one constructor from a single constructor. Let\u2019s understand the working of constructor chaining with a diagram.<\/span><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/06\/Working-of-Constructor-chaining-in-java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78988\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/06\/Working-of-Constructor-chaining-in-java.jpg\" alt=\"Working of Constructor chaining in java\" width=\"652\" height=\"635\" \/><\/a><\/p>\n<h3><strong>Rules for Constructor Chaining in Java<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">If you want to use Constructor Chaining in Java, you must follow the below rules:<\/span><\/p>\n<ul>\n<li><b><span style=\"font-weight: 400\">The <\/span><\/b>this() <span style=\"font-weight: 400\">and <\/span>super()<b><span style=\"font-weight: 400\"> statement must always be the first statement inside the constructor.<\/span><\/b><\/li>\n<li><b><span style=\"font-weight: 400\">At lea<\/span><\/b><b><span style=\"font-weight: 400\">st one constructor should be present in the class that has no <\/span>this() <span style=\"font-weight: 400\">keyword inside it.<\/span><\/b><\/li>\n<li>We can implement the constructor chaining in any order.<\/li>\n<\/ul>\n<h3><strong>Constructor Chaining Example in Java<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">Let\u2019s understand the code to implement constructor chaining in Java using both this and super keyword.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.constructorchaining;\nclass Student {\n  private String name;\n  private int age;\n\n  public Student() {\n    this(\"Shreya\"); \/\/calling one-argument constructor of same class\n    System.out.println(\"Inside no-argument constructor of the Base class\");\n  }\n\n  public Student(String name) {\n    this.name = name;\n    System.out.println(\"Inside the one-argument constructor of the Base class\");\n  }\n\n  public Student(String name, int age) {\n    this.name = name;\n    this.age = age;\n    System.out.println(\"Inside the two-argument constructor of the Base class\");\n  }\n}\nclass MedicalStudent extends Student {\n  public MedicalStudent() {\n    System.out.println(\"Inside no argument constructor of the Derived class\");\n  }\n\n  public MedicalStudent(String name) {\n    super(name); \/\/calling one argument constructor of the base class\n    System.out.println(\"Inside the one-argument constructor from Derived class\");\n  }\n\n  public MedicalStudent(String name, int age) {\n    super(name, age);\n    System.out.println(\"Inside the two-argument constructor of the Derived class\");\n  }\n}\npublic class Test {\n  public static void main(String args[]) {\n    \/\/ Testing constructor chaining in Java\n    MedicalStudent sub = new MedicalStudent(\"Priya\");\n    \/\/caliing one-argument constructor\n    MedicalStudent sub1 = new MedicalStudent(\"Deepak\", 23);\n    \/\/caliing two-argument constructor\n  }\n}<\/pre>\n<p><b>Output:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Inside the one-argument constructor of the Base class<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside the one-argument constructor from Derived class<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside the two-argument constructor of the Base class<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside the two-argument constructor of the Derived class<\/span><\/p>\n<h3><strong>What happens if we change the order of constructors?<\/strong><\/h3>\n<p><strong>Original Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.constructorchaining;\npublic class Demo\n{\n  Demo()\n  {\n    System.out.println(\"Default constructor\");\n  }\n  Demo(int x)\n  {\n    this();\n    System.out.println(\"One-argument constructor\");\n    System.out.println(x);\n  }\n  Demo(int x, int y)\n  {\n    this(5);\n    System.out.println(\"Two-argument constructor\");\n    System.out.println(x * y);\n  }\n  public static void main(String args[ ])\n  {\n    new Demo(8, 10);\n  }\n}\n<\/pre>\n<p><b>Output:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Default constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">One-argument constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">5<\/span><\/p>\n<p><span style=\"font-weight: 400\">Two-argument constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">80<\/span><\/p>\n<p><b>Code after changing the order of constructors:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.constructorchaining;\npublic class Demo\n{\n  Demo()\n  {\n    this(5);\n    System.out.println(\"The Default constructor\");\n  }\n  Demo(int x)\n  {\n    this(5, 15);\n    System.out.println(\"One-argument constructor\");\n\n    System.out.println(x);\n  }\n  Demo(int x, int y)\n  {\n    System.out.println(\"Two-argument constructor\");\n\n    System.out.println(x * y);\n  }\n  public static void main(String args[])\n  {\n    new Demo();\n  }\n}\n<\/pre>\n<p><b>Output:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Two-argument constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">75<\/span><\/p>\n<p><span style=\"font-weight: 400\">One-argument constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">5<\/span><\/p>\n<p><span style=\"font-weight: 400\">The Default constructor<\/span><\/p>\n<h3><strong>Alternative method of constructor chaining using init block<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">There are some programs, in which each constructor has at least the same line of code that executes each time of constructor call. <\/span><\/p>\n<p><span style=\"font-weight: 400\">In this case, we can put these common lines of code inside the<\/span><b> init<\/b><span style=\"font-weight: 400\"> block. This block always executes first before the execution of any constructor.\u00a0<\/span><\/p>\n<p><strong>Let\u2019s see how can we use this init block in our Java code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.constructorchaining;\npublic class InitDemo \n{\n  \/\/ block to be executed before any constructor. \n  { \n    System.out.println(\"Inside init block\"); \n  } \n\n  \/\/Default constructor \n  InitDemo() \n  { \n    System.out.println(\"Inside Default constructor\"); \n  } \n\n  \/\/ parameterized constructor with one argument. \n  InitDemo(int n) \n  { \n    System.out.println(\"Inside Parameterized constructor\");\n    System.out.println(n); \n  } \n  public static void main(String[] args) \n  { \n    \/\/ Object creation by calling no-argument constructor. \n    new InitDemo(); \n\n    \/\/ Object creation by calling one-argument constructor.\n    new  InitDemo(10); \n  } \n}\n<\/pre>\n<p><b>Output:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Inside init block<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside Default constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside init block<\/span><\/p>\n<p><span style=\"font-weight: 400\">Inside Parameterized constructor<\/span><\/p>\n<p><span style=\"font-weight: 400\">10<\/span><\/p>\n<h4><strong>Important points about Constructor chaining in Java<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">After having plenty of knowledge on the Constructor Chaining in Java, let\u2019s discuss some important points about it that you must know:<\/span><\/p>\n<p><strong>1.<\/strong> The call statement to one constructor either by the this() or the super() keyword must always be the first statement inside any constructor.<\/p>\n<p><span style=\"font-weight: 400\"><strong>2. <\/strong>If you do not write any constructor in your code, then Java automatically adds a default constructor inside the class.<\/span><\/p>\n<h4><strong>Conclusion<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Constructors are like methods in Java but they do not have any return type and they are called when the object of the class is created.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> The invocation of one constructor from another constructor within the same class or different class is known as constructor chaining in Java. <\/span><\/p>\n<p><span style=\"font-weight: 400\">If we have to call a constructor within the same class, we use \u2018this\u2019 keyword and if we want to call it from another class we use the \u2018super\u2019 keyword. These two different classes must be in the relationship of inheritance. <\/span><\/p>\n<p><span style=\"font-weight: 400\">We understood the working of constructor chaining and also discussed the result of changing the order of constructors.\u00a0<\/span><\/p>\n<p><strong>Do share your feedback in the comment section if you liked the article.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our previous article, we discussed what is a Constructor and Copy Constructor in Java. In this article, we will discuss Constructor Chaining in Java. Constructor Chaining is the process of invoking one constructor&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":78987,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[2055,2775,2776],"class_list":["post-78936","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-constructor-chaining-in-java","tag-example-of-constructor-chaining-in-java","tag-java-constructor-chaining"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Constructor Chaining Example and Implementation - TechVidvan<\/title>\n<meta name=\"description\" content=\"Constructor chaining in java - What is java constructor chaining, working &amp; example, ways to implement it using this and super keyword, rules &amp; need for it\" \/>\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\/java-constructor-chaining\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Constructor Chaining Example and Implementation - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Constructor chaining in java - What is java constructor chaining, working &amp; example, ways to implement it using this and super keyword, rules &amp; need for it\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/\" \/>\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-04T04:30:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Constructor-Chaining-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=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Constructor Chaining Example and Implementation - TechVidvan","description":"Constructor chaining in java - What is java constructor chaining, working & example, ways to implement it using this and super keyword, rules & need for it","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\/java-constructor-chaining\/","og_locale":"en_US","og_type":"article","og_title":"Java Constructor Chaining Example and Implementation - TechVidvan","og_description":"Constructor chaining in java - What is java constructor chaining, working & example, ways to implement it using this and super keyword, rules & need for it","og_url":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-06-04T04:30:36+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Constructor-Chaining-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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Java Constructor Chaining Example and Implementation","datePublished":"2020-06-04T04:30:36+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/"},"wordCount":992,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Constructor-Chaining-in-Java.jpg","keywords":["Constructor Chaining in Java","Example of Constructor Chaining in Java","Java Constructor Chaining"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/","url":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/","name":"Java Constructor Chaining Example and Implementation - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Constructor-Chaining-in-Java.jpg","datePublished":"2020-06-04T04:30:36+00:00","description":"Constructor chaining in java - What is java constructor chaining, working & example, ways to implement it using this and super keyword, rules & need for it","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Constructor-Chaining-in-Java.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/06\/Constructor-Chaining-in-Java.jpg","width":802,"height":420,"caption":"Java Constructor Chaining"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/java-constructor-chaining\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Java Constructor Chaining Example and Implementation"}]},{"@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\/78936","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=78936"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/78936\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/78987"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=78936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=78936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=78936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}