{"id":14565,"date":"2023-03-20T09:23:14","date_gmt":"2023-03-20T09:23:14","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=14565"},"modified":"2023-12-22T05:21:02","modified_gmt":"2023-12-22T05:21:02","slug":"static-binding-and-dynamic-binding-in-java","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/","title":{"rendered":"Static Binding and Dynamic Binding In Java"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg\" alt=\"\" \/><\/p>\n<p>In the world of Java programming, understanding the concepts of static binding and dynamic binding is fundamental to writing efficient and flexible code. Binding refers to the process of connecting a method call to its definition. In Java, two types of binding mechanisms, namely static binding and dynamic binding, play a crucial role in determining how method calls are resolved during the program&#8217;s execution. This distinction is essential for developers to design robust and maintainable software solutions. Let&#8217;s delve into the intricacies of static and dynamic binding and explore their significance in Java programming.<\/p>\n<h2>What is Binding in Java?<\/h2>\n<p>Before directly jumping into a static binding and dynamic binding let&#8217;s first have a brief idea about binding. In java, binding refers to the process of linking a method call to its corresponding method implementation. Binding decides which method implementation is classed when a method is called. Binding can happen either at runtime or at compile time.<\/p>\n<p>Binding and polymorphism, which refer to the capacity of objects of various classes to be treated as though they are objects of the same class, are closely related in Java. Inheritance and method overriding, which let a subclass offer a distinct implementation of a method that is already specified in its superclass, are two ways that polymorphism is accomplished. Whether static or dynamic binding is used depends on the nature of the reference variable that is used to invoke the function.<\/p>\n<h2>Types of Binding in Java<\/h2>\n<p>In java, there are mainly two types of binding and they are<\/p>\n<ul>\n<li>Static Binding: Happens at compile time<\/li>\n<li>Dynamic Binding: Happens at run time<\/li>\n<\/ul>\n<h2>Static Binding<\/h2>\n<p>Static binding can also be named early binding. The method call in static binding is resolved at the compile time, which means the method to be executed and the corresponding implementation is determined at the time of compilation. It is performed based on the type of reference variable, rather than the object that it refers to. Mainly it is used when the method is defined in the class and there is no overriding of the method in the subclass.<\/p>\n<p>Static binding is also known as early binding. In static binding, the method call is resolved at compile-time, which means the method to be executed is determined at the time of compilation. This binding is performed based on the type of the reference variable, rather than the object that it refers to. It is usually used when the method is defined in the class and there is no overriding of the method in the subclass.<\/p>\n<h3>Example of Static Binding in Java<\/h3>\n<p>In this section, we will see an example of static binding with code implementation and example.<\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_14509 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_14509 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_14509 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_14509 .wpsm_nav-tabs > li.active > a, #tab_container_14509 .wpsm_nav-tabs > li.active > a:hover, #tab_container_14509 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_14509 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_14509 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_14509 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_14509 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_14509 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_14509 .wpsm_nav-tabs > li > a:hover , #tab_container_14509 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_14509 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_14509 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_14509 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_14509 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_14509 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_14509 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_14509 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_14509 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_14509 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_14509 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_14509 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_14509\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_14509\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_14509_1\" aria-controls=\"tabs_desc_14509_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_14509\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_14509_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">class Shape{\r\n  void draw(){\r\n      System.out.println(\"Drawing Shape\");\r\n  }\r\n}\r\nclass Rectangle extends Shape{\r\n  void draw(){\r\n      System.out.println(\"Drawing Rectangle\");\r\n  }\r\n  void print(){\r\n      System.out.println(\"Printing Rectangle\");\r\n  }\r\n}\r\nclass Test{\r\n  public static void main(String[] args){\r\n      Shape s1 = new Shape();\r\n      Shape s2 = new Rectangle();\r\n      Rectangle r = new Rectangle();\r\n      s1.draw();\r\n      s2.draw();\r\n      r.print();\r\n  }\r\n}\r\n\r\n<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_14509 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_14509 a\"),jQuery(\"#tab-content_14509\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>Drawing Shape\nDrawing Rectangle\nPrinting Rectangle<\/code><\/pre>\n<p><strong>Explanation of the above example<\/strong><br \/>\nIn the above example we have a child class rectangle that extends the parent class shape. The shape class has a draw() method and the rectangle class also has a draw() method but the parent calls prints \u201cDrawing Shape\u201d whereas the rectangle class prints \u201cDrawing Rectangle\u201d to the console and there is also the print() method in the rectangle class that prints \u201cPrinting Rectangle\u201d to the console.<\/p>\n<p>Now in the main method, we have created three objects one of type shape and 2 of type rectangle. S1 is of type shape and s2 and r are of type rectangle.<br \/>\nIn the main method, we create three objects \u2013 s1 of type Shape, s2 of type Rectangle, and r of type Rectangle. The draw() function will display &quot;Drawing Shape&quot; to the console when we use s1 to call it. When we call the draw() function using s2, it will display &quot;Drawing Rectangle&quot; to the console. This is so because the reference variable s2&#8217;s class, Shape, determines whether the draw() function is invoked. When we execute the print() function using r, it will print \u201cPrinting Rectangle\u201d to the console.<\/p>\n<h3>Advantages of Static Binding<\/h3>\n<p>The advantages of static binding are given below.<\/p>\n<ul>\n<li>As it is resolved at compile time it is faster.<\/li>\n<li>It is less prone to errors as during compilation the compiler checks for any error in the method and its implementation.<\/li>\n<\/ul>\n<h3>Disadvantages of Static Binding<\/h3>\n<p>The disadvantages of static binding are given below.<\/p>\n<ul>\n<li>It is less flexible as it cannot be changed at runtime.<\/li>\n<li>Sometimes it leads to unexpected behavior when the reference type does not match the object type.<\/li>\n<\/ul>\n<h2>Dynamic Binding<\/h2>\n<p>Dynamic binding is also known as late binding or runtime polymorphism. In dynamic binding, the method call is resolved at runtime, which means the method to be executed is determined at the time of execution. This binding is performed based on the type of object that it refers to, rather than the type of reference variable. It is usually used when the method is overridden in the subclass. It is resolved based on the object type.<\/p>\n<h3>Example of Dynamic Binding in Java<\/h3>\n<p>Now we will see an example of dynamic binding with proper code and explanation.<\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_14510 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_14510 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_14510 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_14510 .wpsm_nav-tabs > li.active > a, #tab_container_14510 .wpsm_nav-tabs > li.active > a:hover, #tab_container_14510 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_14510 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_14510 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_14510 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_14510 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_14510 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_14510 .wpsm_nav-tabs > li > a:hover , #tab_container_14510 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_14510 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_14510 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_14510 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_14510 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_14510 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_14510 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_14510 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_14510 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_14510 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_14510 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_14510 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_14510\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_14510\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_14510_1\" aria-controls=\"tabs_desc_14510_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_14510\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_14510_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">class Shape{\r\n  void draw(){\r\n      System.out.println(\"Drawing Shape\");\r\n  }\r\n}\r\nclass Rectangle extends Shape{\r\n  void draw(){\r\n      System.out.println(\"Drawing Rectangle\");\r\n  }\r\n  void print(){\r\n      System.out.println(\"Printing Rectangle\");\r\n  }\r\n}\r\npublic class Test{\r\n  static void printDrawing(Shape s){\r\n      s.draw();\r\n  }\r\n  public static void main(String[] args){\r\n      Shape s1 = new Shape();\r\n      Shape s2 = new Rectangle();\r\n      Rectangle r = new Rectangle();\r\n      printDrawing(s1);\r\n      printDrawing(s2);\r\n      r.print();\r\n  }\r\n}\r\n\r\n<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_14510 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_14510 a\"),jQuery(\"#tab-content_14510\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>Drawing Shape\nDrawing Rectangle\nPrinting Rectangle<\/code><\/pre>\n<p><strong>Explanation of the above code<\/strong><br \/>\nIn the above example we have a parent class named shape and child class named rectangle. The draw method in the shape class is printing \u201cDrawing Shape\u201d whereas the draw method in the rectangle class is printing\u201d Drawing Rectangle\u201d  whereas the print method is printing \u201c Printing Rectangle\u201d to the console.<\/p>\n<p>We have also created a static method printDrawing() that takes an argument of type Shape. This method calls the draw() method using the Shape reference variable.<\/p>\n<p>In the main method, we create three objects \u2013 s1 of type Shape, s2 of type Rectangle, and r of type Rectangle. We call the printDrawing() method using s1 and s2. When we call it using s1, it will print \u201cDrawing Shape\u201d to the console. When we call it using s2, it will print \u201cDrawing Rectangle\u201d to the console. This is because the draw() method is called based on the actual object type, which is Shape for s1 and Rectangle for s2. When we call the print() method using r, it will print \u201cPrinting Rectangle\u201d to the console.<\/p>\n<h3>Advantages of Dynamic Binding<\/h3>\n<p>Below are some of the advantages of dynamic binding.<\/p>\n<ul>\n<li>It is more flexible as we can change the object at runtime.<\/li>\n<li>It allows for polymorphism, which means the same method can behave differently depending on the object type.<\/li>\n<\/ul>\n<h3>Disadvantages of Dynamic Binding<\/h3>\n<p>Some of the disadvantages of dynamic binding are given below.<\/p>\n<ul>\n<li>As it resolves at run time so it is comparatively slower than static binding.<\/li>\n<li>It is more error-prone as the compiler is not checking for errors at compile time.<\/li>\n<\/ul>\n<h2>Difference between Static Binding and Dynamic Binding<\/h2>\n<p>Now we will see some points of difference between static binding and dynamic binding.<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Static Binding<\/th>\n<th>Dynamic Binding<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Time of Binding<\/td>\n<td>Occurs at compile time<\/td>\n<td>Occurs at runtime<\/td>\n<\/tr>\n<tr>\n<td>Method Resolution<\/td>\n<td>Method is executed based on the type of reference variable used to call the method<\/td>\n<td>Method is executed is based on the actual type of object that the reference variables refer to.<\/td>\n<\/tr>\n<tr>\n<td>Overloading and OVerriding<\/td>\n<td>Static binding is used for method overloading.<\/td>\n<td>Dynamic binding is used for method overriding.<\/td>\n<\/tr>\n<tr>\n<td>Flexibility<\/td>\n<td>It is less flexible than dynamic binding<\/td>\n<td>It is more flexible than static binding<\/td>\n<\/tr>\n<tr>\n<td>Performance<\/td>\n<td>It is faster than dynamic binding.<\/td>\n<td>It is slower than static binding.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Conclusion<\/strong><br \/>\nIn conclusion, a solid understanding of static binding and dynamic binding in Java is essential for Java developers aiming to create efficient, adaptable, and maintainable code. Static binding, with its compile-time resolution, offers performance benefits, while dynamic binding provides flexibility and polymorphic capabilities at runtime. Striking the right balance between these two binding mechanisms is crucial for designing robust and scalable Java applications. Armed with this knowledge, developers can make informed decisions to optimize code execution and build software that meets the demands of diverse and dynamic environments.<\/p>\n<h2>Frequently Asked Questions related to Static Binding and Dynamic Binding In Java<\/h2>\n<p>Here are some of the frequently asked questions about static binding and dynamic binding.<\/p>\n<p><strong>1. Is polymorphism an example of static binding or dynamic binding?<\/strong><br \/>\nPolymorphism is an example of dynamic binding because the method implementation is determined at runtime based on the actual object type.<\/p>\n<p><strong>2. What is a virtual method in Java?<\/strong><br \/>\nA virtual method is a method that is resolved at runtime based on the actual object type.<\/p>\n<p><strong>3. How does Static Binding contribute to performance optimization?<\/strong><br \/>\nStatic binding allows the Java compiler to optimize method calls during the compilation phase. Since the method to be called is known at compile time, the compiler can perform various optimizations, leading to faster and more efficient code execution. However, the downside is that it lacks the flexibility provided by dynamic binding.<\/p>\n<p><strong>4. What advantages does Dynamic Binding offer in Java?<\/strong><br \/>\nDynamic binding enhances code flexibility and promotes polymorphism. It enables the creation of more adaptable and extensible systems by allowing method implementations to be determined dynamically at runtime. This is particularly useful in scenarios where the exact method to be called may only be known during program execution.<\/p>\n<p><strong>5. How can a developer achieve Dynamic Binding in Java?<\/strong><br \/>\nDynamic binding is achieved through method overriding, a key feature of polymorphism in Java. When a subclass provides a specific implementation for a method that is already present in its superclass, dynamic binding comes into play. The actual method called is determined by the type of object the reference variable is pointing to at runtime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the world of Java programming, understanding the concepts of static binding and dynamic binding is fundamental to writing efficient and flexible code. Binding refers to the process of connecting a method call to its definition. In Java, two types of binding mechanisms, namely static binding and dynamic binding, play a crucial role in determining [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[143],"tags":[],"class_list":["post-14565","post","type-post","status-publish","format-standard","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Static Binding and Dynamic Binding In Java<\/title>\n<meta name=\"description\" content=\"Understand Static Binding and Dynamic Binding with examples in Java. Also know the difference between Static Binding and Dynamic Binding.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Static Binding and Dynamic Binding In Java\" \/>\n<meta property=\"og:description\" content=\"Understand Static Binding and Dynamic Binding with examples in Java. Also know the difference between Static Binding and Dynamic Binding.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-20T09:23:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-22T05:21:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"Static Binding and Dynamic Binding In Java\",\"datePublished\":\"2023-03-20T09:23:14+00:00\",\"dateModified\":\"2023-12-22T05:21:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\"},\"wordCount\":1565,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\",\"name\":\"Static Binding and Dynamic Binding In Java\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg\",\"datePublished\":\"2023-03-20T09:23:14+00:00\",\"dateModified\":\"2023-12-22T05:21:02+00:00\",\"description\":\"Understand Static Binding and Dynamic Binding with examples in Java. Also know the difference between Static Binding and Dynamic Binding.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/java\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Static Binding and Dynamic Binding In Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Static Binding and Dynamic Binding In Java","description":"Understand Static Binding and Dynamic Binding with examples in Java. Also know the difference between Static Binding and Dynamic Binding.","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:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Static Binding and Dynamic Binding In Java","og_description":"Understand Static Binding and Dynamic Binding with examples in Java. Also know the difference between Static Binding and Dynamic Binding.","og_url":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2023-03-20T09:23:14+00:00","article_modified_time":"2023-12-22T05:21:02+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"Static Binding and Dynamic Binding In Java","datePublished":"2023-03-20T09:23:14+00:00","dateModified":"2023-12-22T05:21:02+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/"},"wordCount":1565,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/","url":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/","name":"Static Binding and Dynamic Binding In Java","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg","datePublished":"2023-03-20T09:23:14+00:00","dateModified":"2023-12-22T05:21:02+00:00","description":"Understand Static Binding and Dynamic Binding with examples in Java. Also know the difference between Static Binding and Dynamic Binding.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1679034649499-Static%20Binding%20and%20Dynamic%20Binding%20In%20Java.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/static-binding-and-dynamic-binding-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/prepbytes.com\/blog\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Static Binding and Dynamic Binding In Java"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/14565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=14565"}],"version-history":[{"count":4,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/14565\/revisions"}],"predecessor-version":[{"id":18543,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/14565\/revisions\/18543"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=14565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=14565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=14565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}