{"id":88557,"date":"2023-12-21T18:00:36","date_gmt":"2023-12-21T12:30:36","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=88557"},"modified":"2023-12-21T18:00:36","modified_gmt":"2023-12-21T12:30:36","slug":"java-exception-handling-with-method-overriding","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/","title":{"rendered":"Exception Handling with Method Overriding in Java"},"content":{"rendered":"<p>In the following sections, we will unravel the art of harmonizing method overriding and exception handling, shedding light on how these two facets can complement and enhance each other in the pursuit of creating more resilient, maintainable, and user-friendly software. So, let&#8217;s set sail on this enlightening journey, unravelling the intricacies that lie at the intersection of method overriding and exception handling.<\/p>\n<h2>Exception Handling with Method Overriding:<\/h2>\n<p>Exception handling with method overriding in object-oriented programming refers to the process of dealing with exceptions (errors or unexpected situations) that can occur when a subclass overrides a method from its parent (superclass) while maintaining proper error handling and propagation.<\/p>\n<p>When a subclass overrides a method from its superclass, it can choose to either handle exceptions thrown by the overridden method or propagate them up the call chain. Proper exception handling helps ensure that the program behaves as expected and provides meaningful error messages or recovery mechanisms when errors occur.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/09\/Exception-Handling-with-Method-Overriding.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89027 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/09\/Exception-Handling-with-Method-Overriding.webp\" alt=\"Exception Handling with Method Overriding\" width=\"500\" height=\"386\" \/><\/a><\/p>\n<h3>Key points to consider<\/h3>\n<p><strong>Exception Type Matching:<\/strong> When a subclass overrides a method, it must adhere to the same or more specific exceptions (subclasses) in its throws clause. In the example, the Car class method startEngine() is allowed to throw EngineStartException (same exception) or any subclass of it.<\/p>\n<p><strong>No Broader Exception:<\/strong> The subclass is not allowed to throw a broader (more general) exception than its superclass counterpart. For instance, you cannot throw an Exception if the superclass method throws EngineStartException.<\/p>\n<p><strong>Unchecked Exceptions:<\/strong> For unchecked exceptions (subclasses of RuntimeException), you&#8217;re not bound by the exception rules. You can freely throw unchecked exceptions in overridden methods, regardless of whether the superclass method throws checked exceptions.<\/p>\n<p><strong>Overriding without Exception:<\/strong> If the superclass method doesn&#8217;t declare any exceptions (including unchecked exceptions), the subclass is not required to declare any exceptions. It&#8217;s allowed to throw exceptions if needed, but it&#8217;s not mandatory.<\/p>\n<h3>Here are the Problems for exception handling with method overriding in Java:<\/h3>\n<h4>Problem 1 &#8211; No Exception in Superclass:<\/h4>\n<p><strong>Case 1: <\/strong>If the superclass method does not throw any exceptions (neither checked nor unchecked), the subclass method also cannot throw any exceptions. If the subclass method throw the checked exception, we will get a compile time error.<\/p>\n<p><strong>Here&#8217;s an example of Java code where the superclass method does not declare an exception, but the subclass overridden method declares a checked exception:<\/strong><\/p>\n<p><strong>Example code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Superclass {\n    void method() {\n        System.out.println(\"Superclass method\");\n    }\n}\nclass Subclass extends Superclass {\n    @Override\n    void method() throws CustomCheckedException {\n        System.out.println(\"Subclass method\");\n        throw new CustomCheckedException(\"Checked Exception in Subclass\");\n    }\n}\nclass CustomCheckedException extends Exception {\n    CustomCheckedException(String message) {\n        super(message);\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        Superclass instance = new Subclass();\n\n        try {\n            instance.method();\n        } catch (CustomCheckedException e) {\n            System.out.println(\"Caught: \" + e.getMessage());\n        }\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Java: method() in com.company.Subclass cannot override method() in com.company.Superclass<\/p>\n<p>overridden method does not throw com.company.CustomCheckedException<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>The Superclass defines a method called method() that does not declare any exceptions.<\/li>\n<li>The Subclass overrides the method() and declares a CustomCheckedException, a checked exception.<\/li>\n<li>The CustomCheckedException class is a checked exception that extends Exception.<\/li>\n<li>In the main method, an instance of Subclass is created and invoked the method().<\/li>\n<\/ul>\n<p><strong>Case 2: <\/strong>If the superclass method does not throw any exceptions (neither checked nor unchecked),Subclass method can choose to throw unchecked exceptions.<\/p>\n<p><strong>Example Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Superclass {\n    void method() {\n        System.out.println(\"Superclass method\");\n    }\n}\nclass Subclass extends Superclass {\n    @Override\n    void method() {\n        System.out.println(\"Subclass method\");\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        Superclass superClassInstance = new Superclass();\n        Subclass subClassInstance = new Subclass();\n        superClassInstance.method(); \/\/ Output: Superclass method\n        subClassInstance.method();   \/\/ Output: Subclass method\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Superclass method<br \/>\nSubclass method<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<p>In this example, the Superclass defines a method called method() that doesn&#8217;t throw any exceptions. The Subclass overrides this method and also doesn&#8217;t throw any exceptions. The main method demonstrates how both the superclass and subclass methods can be invoked without any issues.<\/p>\n<h4>Problem 2 &#8211; Checked Exception in Superclass:<\/h4>\n<p><strong>Case 1: <\/strong>If the superclass method throws a checked exception; the subclass method can:<\/p>\n<p>a. Throw the same exception.<\/p>\n<p><strong>Example Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class InsufficientFundsException extends Exception {\n    InsufficientFundsException(String message) {\n        super(message);\n    }\n}\nclass BankAccount {\n    protected double balance;\n    BankAccount(double initialBalance) {\n        this.balance = initialBalance;\n    }\n    void withdraw(double amount) throws InsufficientFundsException {\n        if (amount &gt; balance) {\n            throw new InsufficientFundsException(\"Insufficient funds for withdrawal\");\n        }\n        balance -= amount;\n        System.out.println(\"Withdrawal successful. New balance: \" + balance);\n    }\n}\nclass SavingsAccount extends BankAccount {\n    SavingsAccount(double initialBalance) {\n        super(initialBalance);\n    }\n    @Override\n    void withdraw(double amount) throws InsufficientFundsException {\n        try {\n            super.withdraw(amount); \/\/ Call the superclass method\n        } catch (InsufficientFundsException e) {\n            System.out.println(\"SavingsAccount: \" + e.getMessage());\n            \/\/ Perform additional handling specific to SavingsAccount\n        }\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        BankAccount account1 = new SavingsAccount(1000);\n        try {\n            account1.withdraw(1500);\n        } catch (InsufficientFundsException e) {\n            System.out.println(\"Main: \" + e.getMessage());\n            \/\/ Perform general handling for all bank accounts\n        }\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>SavingsAccount: Insufficient funds for withdrawal<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>We have a BankAccount superclass with a method withdraw that can throw an InsufficientFundsException.<\/li>\n<li>The SavingsAccount subclass inherits from BankAccount and overrides the withdraw method. It catches the exception thrown by the superclass method and provides additional handling specific to savings accounts.<\/li>\n<li>In the DataFlair class, we create an instance of SavingsAccount and attempt to withdraw an amount greater than the balance.<\/li>\n<li>The overridden withdraw method in the SavingsAccount class catches the exception, displays a message, and performs additional handling.<\/li>\n<li>The main method also catches the exception and performs general handling for all bank accounts.<\/li>\n<\/ul>\n<p><strong>Case 2: <\/strong>If the superclass method throws a checked exception, the subclass method can:<\/p>\n<p>b. Throw a subclass exception of the exception thrown by the superclass method.<\/p>\n<p><strong>Example code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class ParentException extends Exception {\n    ParentException(String message) {\n        super(message);\n    }\n}\nclass ChildException extends ParentException {\n    ChildException(String message) {\n        super(message);\n    }\n}\nclass Superclass {\n    void method() throws ParentException {\n        System.out.println(\"Superclass method\");\n        throw new ParentException(\"Checked Exception in Superclass\");\n    }\n}\nclass Subclass extends Superclass {\n    @Override\n    void method() throws ChildException {\n        System.out.println(\"Subclass method\");\n        throw new ChildException(\"Subclass Exception in Subclass\");\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        Superclass instance = new Subclass();\n\n        try {\n            instance.method();\n        } catch (ParentException e) {\n            System.out.println(\"Caught: \" + e.getMessage());\n        }\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Subclass method<\/p>\n<p><strong>Caught:<\/strong> Subclass Exception in Subclass<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>The ParentException and ChildException classes represent checked exceptions, where ChildException is a subclass of ParentException.<\/li>\n<li>The Superclass defines a method called method() that throws a ParentException.<\/li>\n<li>The Subclass overrides the method() and throws a ChildException, which is a subclass of ParentException.<\/li>\n<li>In the main method, we create an instance of Subclass and invoke the method(). We catch the ParentException (which includes its subclass ChildException) and print the caught message.<\/li>\n<\/ul>\n<p><strong>Case 3: <\/strong>If the Parentclass method throws a checked exception, the Childclass method can:<\/p>\n<p>c. Choose not to throw any exception.<\/p>\n<p><strong>Example code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class ParentException extends Exception {\n    ParentException(String message) {\n        super(message);\n    }\n}\n\nclass Superclass {\n    void method() throws ParentException {\n        System.out.println(\"Superclass method\");\n        throw new ParentException(\"Checked Exception in Superclass\");\n    }\n}\n\nclass Subclass extends Superclass {\n    @Override\n    void method() {\n        System.out.println(\"Subclass method\");\n        \/\/ No exception thrown in Subclass method\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        Superclass instance = new Subclass();\n\n        try {\n            instance.method();\n        } catch (ParentException e) {\n            System.out.println(\"Caught: \" + e.getMessage());\n        }\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Subclass method<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>The ParentException class represents a checked exception.<\/li>\n<li>The Superclass defines a method called method() that throws a ParentException.<\/li>\n<li>The Subclass overrides the method() and chooses not to throw any exception.<\/li>\n<li>In the main method, we create an instance of Subclass and invoke the method(). Since the Subclass method does not throw an exception, no exception is caught in the catch block.<\/li>\n<\/ul>\n<p><strong>Case 4: <\/strong>If the superclass method throws a checked exception, the subclass method can:<\/p>\n<p>d. Cannot throw a parent exception.<\/p>\n<p><strong>Example code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class ParentException extends Exception {\n    ParentException(String message) {\n        super(message);\n    }\n}\n\nclass Superclass {\n    void method() throws ParentException {\n        System.out.println(\"Superclass method\");\n        throw new ParentException(\"Checked Exception in Superclass\");\n    }\n}\n\nclass Subclass extends Superclass {\n    @Override\n    void method() throws Exception {\n        System.out.println(\"Subclass method\");\n        \/\/ Cannot throw ParentException directly here\n        throw new Exception(\"Exception in Subclass\"); \/\/ A subclass of Exception\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        Superclass instance = new Subclass();\n\n        try {\n            instance.method();\n        } catch (ParentException e) {\n            System.out.println(\"Caught: \" + e.getMessage());\n        }\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>java: method() in com.company.Subclass cannot override method() in com.company.Superclass overridden method does not throw java.lang.Exception<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<p>In this example, the Subclass attempts to throw a parent exception Exception in its overridden method(). This will result in a compilation error because it is not allowed to throw a parent exception. The Superclass method declares ParentException, and any exception thrown by the Subclass must follow the hierarchy rules.<\/p>\n<h4>Problem 3 &#8211; Unchecked Exception in Superclass:<\/h4>\n<p>If the superclass method throws an unchecked exception (subclass of RuntimeException), the subclass method can choose to throw the same exception or any other unchecked exception, including subclasses of RuntimeException.<\/p>\n<p><strong>Example Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class ParentUncheckedException extends RuntimeException {\n    ParentUncheckedException(String message) {\n        super(message);\n    }\n}\nclass Superclass {\n    void method() {\n        System.out.println(\"Superclass method\");\n        throw new ParentUncheckedException(\"Unchecked Exception in Superclass\");\n    }\n}\n\nclass ChildUncheckedException extends ParentUncheckedException {\n    ChildUncheckedException(String message) {\n        super(message);\n    }\n}\nclass Subclass extends Superclass {\n    @Override\n    void method() {\n        System.out.println(\"Subclass method\");\n        throw new ChildUncheckedException(\"Unchecked Exception in Subclass\");\n    }\n}\nclass DataFlair{\n    public static void main(String[] args) {\n        Superclass superClassInstance = new Subclass();\n\n        try {\n            superClassInstance.method();\n        } catch (ParentUncheckedException e) {\n            System.out.println(\"Caught: \" + e.getMessage());\n        }\n    }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Subclass method<\/p>\n<p>Caught: Unchecked Exception in Subclass<\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>The ParentUncheckedException and ChildUncheckedException classes extend RuntimeException, making them unchecked exceptions.<\/li>\n<li>The Superclass defines a method called method() that throws ParentUncheckedException.<\/li>\n<li>The Subclass overrides the method() and throws a ChildUncheckedException.<\/li>\n<li>In the main method, we create an instance of Subclass and invoke the method(). We catch the unchecked exception and print the caught message.<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>When the SuperClass doesn&#8217;t specify any exceptions, the SubClass is limited to declaring only unchecked exceptions, excluding checked exceptions.<\/p>\n<p>If the SuperClass specifies an exception, the SubClass is allowed to declare the same exception or its subclasses, along with new RuntimeExceptions. However, it&#8217;s restricted from introducing any new checked exceptions at the same level or higher.<\/p>\n<p>In the case of the SuperClass specifying an exception, the SubClass can also choose not to declare any exceptions at all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the following sections, we will unravel the art of harmonizing method overriding and exception handling, shedding light on how these two facets can complement and enhance each other in the pursuit of creating&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":89028,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[5232,5233,5234,296,5235,5236],"class_list":["post-88557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-exception-handling","tag-exception-handling-with-method-overriding","tag-exception-handling-with-method-overriding-in-java","tag-java","tag-java-exception-handling-with-method-overriding","tag-method-overriding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Exception Handling with Method Overriding in Java - TechVidvan<\/title>\n<meta name=\"description\" content=\"We will explore Java Exception Handling with Method Overriding, the art of harmonizing method overriding and exception handling.\" \/>\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-exception-handling-with-method-overriding\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exception Handling with Method Overriding in Java - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"We will explore Java Exception Handling with Method Overriding, the art of harmonizing method overriding and exception handling.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/\" \/>\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=\"2023-12-21T12:30:36+00:00\" \/>\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=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Exception Handling with Method Overriding in Java - TechVidvan","description":"We will explore Java Exception Handling with Method Overriding, the art of harmonizing method overriding and exception handling.","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-exception-handling-with-method-overriding\/","og_locale":"en_US","og_type":"article","og_title":"Exception Handling with Method Overriding in Java - TechVidvan","og_description":"We will explore Java Exception Handling with Method Overriding, the art of harmonizing method overriding and exception handling.","og_url":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2023-12-21T12:30:36+00:00","author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Exception Handling with Method Overriding in Java","datePublished":"2023-12-21T12:30:36+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/"},"wordCount":1141,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#primaryimage"},"thumbnailUrl":"","keywords":["exception handling","exception handling with method overriding","exception handling with method overriding in java","java","java exception handling with method overriding","method overriding"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/","url":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/","name":"Exception Handling with Method Overriding in Java - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#primaryimage"},"thumbnailUrl":"","datePublished":"2023-12-21T12:30:36+00:00","description":"We will explore Java Exception Handling with Method Overriding, the art of harmonizing method overriding and exception handling.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/java-exception-handling-with-method-overriding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Exception Handling with Method Overriding 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\/88557","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=88557"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/88557\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=88557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=88557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=88557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}