{"id":4201,"date":"2025-03-10T17:43:07","date_gmt":"2025-03-10T12:13:07","guid":{"rendered":"https:\/\/www.testleaf.com\/blog\/?p=4201"},"modified":"2025-12-04T15:30:20","modified_gmt":"2025-12-04T10:00:20","slug":"epam-interview-questions-with-answers","status":"publish","type":"post","link":"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/","title":{"rendered":"EPAM Interview Questions with Answers"},"content":{"rendered":"<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div><!--[if lt IE 9]><script>document.createElement('audio');<\/script><![endif]-->\n<audio class=\"wp-audio-shortcode\" id=\"audio-4201-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/ogg\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/EPAM-Interview-Questions-with-Answers.ogg?_=1\" \/><a href=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/EPAM-Interview-Questions-with-Answers.ogg\">https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/EPAM-Interview-Questions-with-Answers.ogg<\/a><\/audio>\n<h1><\/h1>\n<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Epam_Interview_Questions_Part_1\"><\/span><b><span data-contrast=\"auto\">Epam Interview Questions:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\"> Part 1<\/span><span class=\"ez-toc-section-end\"><\/span><\/h1><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Epam_Interview_Questions_Part_1\" >Epam Interview Questions: Part 1<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q1_What_framework_you_are_using_and_explain_that\" >Q1) What framework you are using and explain that:\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q2_Write_a_program_declare_array_with_10_int_num_and_remove_the_3rd_index_element_and_print_the_updated_array\" >Q2) Write a program declare array with 10 int num and remove the 3rd index element and print the updated array?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#_Q3_Write_a_program_declare_a_string_and_find_the_occurrences_of_each_and_every_string\" >\u00a0Q3: Write a program, declare a string and find the occurrences of each and every string<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q4_Write_a_program_that_generates_and_displays_the_Fibonacci_sequence\" >Q4) Write a program that generates and displays the Fibonacci sequence.\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q5_What_is_the_difference_between_equals_and_in_Java\" >Q5) What is the difference between .equals and == in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q6_What_will_be_the_output_of_comparing_s1_and_s2_using_the_equals_method_and_the_operator\" >Q6) What will be the output of comparing s1 and s2 using the .equals() method and the == operator?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q7_What_is_an_Interface_and_an_Abstract_Class_in_Java_Briefly_explain_the_differences_between_them\" >Q7) What is an Interface and an Abstract Class in Java? Briefly explain the differences between them<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#_1_Interface\" >\u00a0 \u00a0 \u00a01. Interface<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q8_What_are_the_core_Object-Oriented_Programming_OOP_concepts_in_Java\" >Q8) What are the core Object-Oriented Programming (OOP) concepts in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q9_What_is_polymorphism_and_give_examples_from_your_automation\" >Q9) What is polymorphism and give examples from your automation?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q10_Can_we_override_a_private_method_in_Java_Why_or_why_not\" >Q10) Can we override a private method in Java? Why or why not?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q11_Can_we_override_a_static_variable_in_Java\" >Q11) Can we override a static variable in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q12_Can_we_declare_a_class_as_final_in_Java\" >Q12) Can we declare a class as final in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q13_What_is_the_difference_between_an_Array_and_an_ArrayList_in_Java\" >Q13) What is the difference between an Array and an ArrayList in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q14_What_is_a_HashMap_in_Java_and_how_does_it_work\" >Q14) What is a HashMap in Java, and how does it work?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q15_What_are_the_differences_between_an_ArrayList_and_a_LinkedList_in_Java\" >Q15) What are the differences between an ArrayList and a LinkedList in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q16_What_is_the_difference_between_a_Set_and_a_List_in_Java\" >Q16) What is the difference between a Set and a List in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q17_What_are_the_commonly_used_classes_that_implement_the_List_and_Set_interfaces_in_Java\" >Q17) What are the commonly used classes that implement the List and Set interfaces in Java?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q18_What_are_the_return_types_of_getWindowHandle_and_getWindowHandles_in_Selenium_WebDriver_and_what_do_they_represent\" >Q18) What are the return types of getWindowHandle() and getWindowHandles() in Selenium WebDriver, and what do they represent?\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/#Q19_x-path_axes_what_is_following_and_following_sibling\" >Q19) x-path axes\/ what is following and following sibling<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<h3><b><span data-contrast=\"auto\">Introduction<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:180,&quot;335559739&quot;:180,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Preparing for an EPAM interview? In this blog post, we\u2019ll break down some of the most common EPAM interview questions\u2014covering everything from explaining your automation framework to solving real-world coding challenges. Whether you&#8217;re a seasoned automation engineer or just starting your journey, these insights will help you showcase your technical know-how and problem-solving skills. Let&#8217;s dive in and get you ready to impress!<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:180,&quot;335559739&quot;:180,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q1_What_framework_you_are_using_and_explain_that\"><\/span><b><span data-contrast=\"auto\">Q1) What framework you are using and explain that:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h5 aria-level=\"3\"><b><span data-contrast=\"auto\">Framework Overview<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<h5><b><span data-contrast=\"auto\">1. Hybrid Framework:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<ul>\n<li><b><span data-contrast=\"auto\">Design Pattern:<\/span><\/b><span data-contrast=\"auto\"> Built on the Page Object Model (POM) design pattern.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559731&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Dependency Management:<\/span><\/b><span data-contrast=\"auto\"> Utilizes Maven for managing project dependencies.<\/span><\/li>\n<\/ul>\n<h5><b><span data-contrast=\"auto\">\u00a0 2. External Libraries<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<ul>\n<li><b><span data-contrast=\"auto\"><a href=\"https:\/\/www.testleaf.com\/course\/selenium-automation-certification-training-course.html\">Selenium WebDriver<\/a>:\u00a0 <\/span><\/b><span data-contrast=\"auto\">Used to interact with web applications.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">TestNG: <\/span><\/b><span data-contrast=\"auto\">Facilitates controlled test execution.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Apache POI: <\/span><\/b><span data-contrast=\"auto\">Supports data-driven testing (e.g., reading data from Excel).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Cucumber: <\/span><\/b><span data-contrast=\"auto\">Enables BDD (Behavior Driven Development) automation.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Extent Report: <\/span><\/b><span data-contrast=\"auto\">Generates HTML summary reports for test results.<\/span><\/li>\n<\/ul>\n<h5 aria-level=\"3\"><b><span data-contrast=\"auto\">Framework Components<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559731&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<p><b><span data-contrast=\"auto\">1.\u00a0 Browser (Interface) &#8211; <\/span><\/b><span data-contrast=\"auto\">Defines methods for browser-related interactions.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">2. Element (Interface) &#8211; <\/span><\/b><span data-contrast=\"auto\">Defines methods for element-related interactions.<\/span><\/p>\n<p><b><span data-contrast=\"auto\">3. Selenium Base<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">Implementation: <\/span><\/b><span data-contrast=\"auto\">Implements both the Browser and Element interfaces.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Reusable Methods:<\/span><\/b><span data-contrast=\"auto\"> Acts as a library containing reusable automation methods.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Wrapper Class:<\/span><\/b><span data-contrast=\"auto\"> Contains wrapper methods that simplify Selenium commands.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Exception Handling:<\/span><\/b><span data-contrast=\"auto\"> Implements exception handling using try\/catch blocks across all methods.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">4. ProjectSpecificMethods<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">Base Class:<\/span><\/b><span data-contrast=\"auto\"> Serves as the base for all page classes and test case classes.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Common Utilities:<\/span><\/b><span data-contrast=\"auto\"> Contains common methods and variables shared across pages and test cases.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">5. Pages<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Contains Java classes for each individual page in the application.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">6. TestCases<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Contains <a href=\"https:\/\/en.wikipedia.org\/wiki\/Java_(programming_language)\">Java<\/a> classes for each test case.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">7. Utils<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">DataLibrary:<\/span><\/b><span data-contrast=\"auto\"> Handles reading data from Excel files.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Reporter:<\/span><\/b><span data-contrast=\"auto\"> Contains configurations and methods for ExtentReport.<\/span><\/li>\n<\/ul>\n<h5><b><span data-contrast=\"auto\">Hierarchy of classes:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-4204\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/undefined.png\" alt=\"\" width=\"296\" height=\"437\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/undefined.png 296w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/undefined-203x300.png 203w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/undefined-150x221.png 150w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/p>\n<h5><b><span data-contrast=\"auto\">\u00a0Execution flow:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<h5><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\"> <img decoding=\"async\" class=\"aligncenter size-full wp-image-4206\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/Execution-flow.png\" alt=\"Execution flow\" width=\"385\" height=\"158\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/Execution-flow.png 385w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/Execution-flow-300x123.png 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/03\/Execution-flow-150x62.png 150w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/span><\/h5>\n<h2><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"Q2_Write_a_program_declare_array_with_10_int_num_and_remove_the_3rd_index_element_and_print_the_updated_array\"><\/span><b><span data-contrast=\"auto\">Q2) Write a program declare array with 10 int num and remove the 3rd index element and print the updated array?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">Program:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p>public class RemoveElement {<br \/>\npublic static void main(String[] args) {<br \/>\n\/\/ Declare and initialize an array with 10 integers<br \/>\nint[] arr = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};<\/p>\n<p>\/\/ The index to remove (3rd index = 4th element)<br \/>\nint removeIndex = 3;<\/p>\n<p>\/\/ Shift elements to the left starting from the removeIndex<br \/>\nfor (int i = removeIndex; i &lt; arr.length &#8211; 1; i++) {<br \/>\narr[i] = arr[i + 1];<br \/>\n}<\/p>\n<p>\/\/ Create a new array with one less element<br \/>\nint[] newArr = new int[arr.length &#8211; 1];<br \/>\nfor (int i = 0; i &lt; newArr.length; i++) {<br \/>\nnewArr[i] = arr[i];<br \/>\n}<\/p>\n<p>\/\/ Print the updated array<br \/>\nSystem.out.println(&#8220;Updated array:&#8221;);<br \/>\nfor (int num : newArr) {<br \/>\nSystem.out.print(num + &#8221; &#8220;);<br \/>\n}<br \/>\n}<br \/>\n}<\/p><\/blockquote>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><strong>Output:\u00a0<\/strong><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\"> Updated array: <\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">10 20 30 50 60 70 80 90 100<\/span><\/p>\n<h5><b><span data-contrast=\"auto\">Explanation:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<ol>\n<li><b><span data-contrast=\"auto\">Array Declaration:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">An array <\/span><span data-contrast=\"auto\">arr<\/span><span data-contrast=\"auto\"> is declared with 10 integers.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Element Removal:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">We choose the 3rd index (which corresponds to the 4th element) as the removal target.<\/span><br \/>\n<span data-contrast=\"auto\">A loop shifts each element after this index one position to the left.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">New Array Creation:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">Since the array size is fixed, we create a new array <\/span><span data-contrast=\"auto\">newArr<\/span><span data-contrast=\"auto\"> that is one element shorter and copy the shifted values into it.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Printing:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">Finally, we print the elements of <\/span><span data-contrast=\"auto\">newArr<\/span><span data-contrast=\"auto\">, which represents the updated array after removing the element at index 3.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"_Q3_Write_a_program_declare_a_string_and_find_the_occurrences_of_each_and_every_string\"><\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0Q3: <\/span><b style=\"font-style: inherit;\"><span data-contrast=\"none\">Write a program, declare a string and find the occurrences of each and every string<\/span><\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"none\">Program:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p>public class OccuranceOfEachCharacter {<br \/>\npublic static void main(String[] args) {<br \/>\nString str = &#8220;welcome to testleaf&#8221;;<br \/>\nint count = 0;<br \/>\nfor (int j = 0; j &lt; str.length(); j++) {<br \/>\ncount = 0;<br \/>\nchar c = str.charAt(j);<br \/>\nfor (int i = 0; i &lt; str.length(); i++) {<br \/>\nif (c == str.charAt(i)) {<br \/>\ncount++;<br \/>\n}<br \/>\n}<br \/>\nSystem.out.println(c + occurs + count + 11 11 11 times in 11 + str);<br \/>\n}<br \/>\n}<br \/>\n}<\/p><\/blockquote>\n<p><b><span data-contrast=\"auto\">Output:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> w occurs 1 times in welcome to testleaf<br \/>\ne occurs 4 times in welcome to testleaf<br \/>\n1 occurs 2 times in welcome to testleaf<br \/>\ncoccurs 1 times in welcome to testleaf<br \/>\no occurs 2 times in welcome to testleaf<br \/>\nmoccurs 1 times in welcome to testleaf<br \/>\ne occurs 4 times in welcome to testleaf<br \/>\noccurs 2 times in welcome to testleaf<br \/>\nt occurs 3 times in welcome to testleaf<br \/>\no occurs 2 times in welcome to testleaf<br \/>\noccurs 2 times in welcome to testleaf<br \/>\nt occurs 3 times in welcome to testleaf<br \/>\ne occurs 4 times in welcome to testleaf<br \/>\ns occurs 1 times in welcome to testleaf<br \/>\nt occurs 3 times in welcome to testleaf<br \/>\n1 occurs 2 times in welcome to testleaf<br \/>\ne occurs 4 times in welcome to testleaf<br \/>\noccurs 1 times in welcome to testleaf<br \/>\nf occurs 1 times in welcome to testleaf<\/span><\/p>\n<h5><b><span data-contrast=\"auto\">Explanation:<\/span><\/b><\/h5>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a01) <\/span><b><span data-contrast=\"auto\">String Declaration:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0The program starts by declaring a string.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0This is the text in which the program will count the occurrence of each character.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a02) <\/span><b><span data-contrast=\"auto\">Outer Loop:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0The outer loop iterates over each character in the string using index <\/span><span data-contrast=\"auto\">j<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0For every character at position <\/span><span data-contrast=\"auto\">j<\/span><span data-contrast=\"auto\">, it resets <\/span><span data-contrast=\"auto\">count<\/span><span data-contrast=\"auto\"> to 0 and assigns that character to variable <\/span><span data-contrast=\"auto\">c<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a03)<\/span><b><span data-contrast=\"auto\">Inner Loop:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0The inner loop then goes through the entire string (using index <\/span><span data-contrast=\"auto\">i<\/span><span data-contrast=\"auto\">) to count how many times the current character <\/span><span data-contrast=\"auto\">c<\/span><span data-contrast=\"auto\"> appears.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Every time the character at position i matches <\/span><span data-contrast=\"auto\">c<\/span><span data-contrast=\"auto\">, the <\/span><span data-contrast=\"auto\">count<\/span><span data-contrast=\"auto\"> is incremented.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a04) <\/span><b><span data-contrast=\"auto\">Printing the Result:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0After counting, the program prints the character along with its count.<\/span><\/p>\n<p><strong><span class=\"TextRun SCXW151396139 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW151396139 BCX8\">Related Articles: <\/span><\/span><\/strong><a class=\"Hyperlink SCXW151396139 BCX8\" href=\"https:\/\/www.testleaf.com\/blog\/hexaware-java-interview-questions-and-answers-2025-top-faqs-to-crack-your-interview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW151396139 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW151396139 BCX8\" data-ccp-charstyle=\"Hyperlink\">https:\/\/www.testleaf.com\/blog\/hexaware-java-interview-questions-and-answers-2025-top-faqs-to-crack-your-interview\/<\/span><\/span><\/a><span class=\"EOP SCXW151396139 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q4_Write_a_program_that_generates_and_displays_the_Fibonacci_sequence\"><\/span><b><span data-contrast=\"auto\">Q4) Write a program that generates and displays the Fibonacci sequence.<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">Program:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> public class FibonacciSeries {<br \/>\npublic static void main(String[] args) {<br \/>\nint n1=0,n2=1,n3, i, count=10;<br \/>\n\/\/printing 0 and 1<br \/>\nSystem.out.println(n2);<br \/>\n\/\/loop starts from 2 because 0 and 1 are already printed<br \/>\nfor(i=2;i&lt;count;++i)<br \/>\n{<br \/>\nn3=n1+n2;<br \/>\nSystem.out.println(n3);<br \/>\nn1=n2;<br \/>\nn2=n3;<br \/>\n}<br \/>\n}<br \/>\n}<\/span><\/p><\/blockquote>\n<p><strong>Output:\u00a0<\/strong><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> 1<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n5<br \/>\n8<br \/>\n13<br \/>\n21<br \/>\n34<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a01) <\/span><b><span data-contrast=\"auto\">Initialization:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0n1 = 0<\/span><span data-contrast=\"auto\">, <\/span><span data-contrast=\"auto\">n2 = 1<\/span><span data-contrast=\"auto\"> \u2014 starting values of the Fibonacci sequence.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559731&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0count = 10<\/span><span data-contrast=\"auto\"> \u2014 total number of iterations.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559731&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a02) <\/span><b><span data-contrast=\"auto\">Process:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0First, the program prints <\/span><span data-contrast=\"auto\">n2<\/span><span data-contrast=\"auto\"> (which is 1).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Then, in a loop (from <\/span><span data-contrast=\"auto\">i = 2<\/span><span data-contrast=\"auto\"> to <\/span><span data-contrast=\"auto\">i &lt; count<\/span><span data-contrast=\"auto\">), it calculates the next Fibonacci number (<\/span><span data-contrast=\"auto\">n3<\/span><span data-contrast=\"auto\">) as <\/span><span data-contrast=\"auto\">n1 + n2<\/span><span data-contrast=\"auto\">, prints it, and updates <\/span><span data-contrast=\"auto\">n1<\/span><span data-contrast=\"auto\"> and <\/span><span data-contrast=\"auto\">n2<\/span><span data-contrast=\"auto\"> for the next iteration.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q5_What_is_the_difference_between_equals_and_in_Java\"><\/span><b><span data-contrast=\"auto\">Q5) What is the difference between .equals and == in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">Explanation:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a01. ==<\/span><\/b><b><span data-contrast=\"auto\"> Operator:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0What it does:<\/span><\/b><span data-contrast=\"auto\"> Compares object references (memory addresses).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559731&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0For Strings:<\/span><\/b><span data-contrast=\"auto\"> Returns <\/span><span data-contrast=\"auto\">true<\/span><span data-contrast=\"auto\"> only if both references point to the exact same object in memory.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a02. equals()<\/span><\/b><b><span data-contrast=\"auto\"> Method:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0What it does:<\/span><\/b><span data-contrast=\"auto\"> Compares the contents of two objects.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0For Strings:<\/span><\/b><span data-contrast=\"auto\"> Returns <\/span><span data-contrast=\"auto\">true<\/span><span data-contrast=\"auto\"> if the sequences of characters in the strings are identical, regardless of whether they are the same object.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:1440,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q6_What_will_be_the_output_of_comparing_s1_and_s2_using_the_equals_method_and_the_operator\"><\/span><b><span data-contrast=\"auto\">Q6) What will be the output of comparing s1 and s2 using the .equals() method and the == operator?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">String s1 = &#8220;hello&#8221;; String s2 = &#8220;hello&#8221;;<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 String s1 = new String(&#8220;Hello&#8221;);<br \/>\nString s2 = new String(&#8220;Hello&#8221;);<br \/>\nSystem.out.println(s1 == s2);<br \/>\n\/\/ Outputs false (different objects)<br \/>\nSystem.out.println(s1.equals(s2));<br \/>\n\/\/ Outputs true (same content)<\/span><\/p><\/blockquote>\n<ol>\n<li data-leveltext=\"%1)\" data-font=\"Times New Roman\" data-listid=\"62\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559685&quot;:1080,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1)&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">s1.equals (s2) will return true because the content of both strings is the same (&#8220;hello&#8221;).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ol>\n<p><span data-contrast=\"auto\">2) s1 == s2 will also return true because both s1 and s2 refer to the same literal in the string pool<\/span><\/p>\n<p><a href=\"https:\/\/www.testleaf.com\/course\/playwright.html?utm_source=blog_post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><img decoding=\"async\" class=\"aligncenter wp-image-5709 size-full\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class.png\" alt=\"Playwright automation testing\" width=\"2048\" height=\"512\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class.png 2048w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class-300x75.png 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class-1024x256.png 1024w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class-768x192.png 768w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class-1536x384.png 1536w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/Playwright-online-class-150x38.png 150w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/p>\n<h2><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"Q7_What_is_an_Interface_and_an_Abstract_Class_in_Java_Briefly_explain_the_differences_between_them\"><\/span><b><span data-contrast=\"auto\">Q7) What is an Interface and an Abstract Class in Java? Briefly explain the differences between them<\/span><\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"_1_Interface\"><\/span><b style=\"font-size: 16px; font-style: inherit;\"><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a01. Interface<\/span><\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">Interfaces are design structures that direct what a class must do. It is placeholder for all abstract methods, and it can also support concrete methods from 1.7 version with default to allow backward compatibility. In our project, we always start with interface so that everyone follows the common standards for developing methods and variables by which we can avoid ambiguity.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ol>\n<li><span data-contrast=\"auto\">a) Java example: List, Set<\/span><\/li>\n<li><span data-contrast=\"auto\">b) Selenium example: SearchContext, WebDriver<\/span><\/li>\n<\/ol>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a02. Abstract Class<\/span><\/b><\/p>\n<p><span data-contrast=\"auto\">Contains both implemented and unimplemented (abstract) methods. Used to partially implement the interface.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ol>\n<li><span data-contrast=\"auto\">a) Java example: AbstractList<\/span><\/li>\n<li><span data-contrast=\"auto\">b) Selenium example: By class<\/span><\/li>\n<\/ol>\n<p><b><span data-contrast=\"auto\">Difference between Interface and Abstract Class in Java:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<table data-start=\"45\" data-end=\"1091\">\n<thead data-start=\"45\" data-end=\"182\">\n<tr data-start=\"45\" data-end=\"182\">\n<th data-start=\"45\" data-end=\"62\">Feature<\/th>\n<th data-start=\"62\" data-end=\"127\">Interface<\/th>\n<th data-start=\"127\" data-end=\"182\">Abstract Class<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"298\" data-end=\"1091\">\n<tr data-start=\"298\" data-end=\"433\">\n<td><strong data-start=\"300\" data-end=\"315\">Method Type<\/strong><\/td>\n<td>Only abstract methods (default\/static methods allowed from Java 8)<\/td>\n<td>Can have both abstract and concrete methods<\/td>\n<\/tr>\n<tr data-start=\"434\" data-end=\"569\">\n<td><strong data-start=\"436\" data-end=\"446\">Fields<\/strong><\/td>\n<td><code data-start=\"455\" data-end=\"476\">public static final<\/code> (constants)<\/td>\n<td>Can have instance variables (any access modifier)<\/td>\n<\/tr>\n<tr data-start=\"570\" data-end=\"711\">\n<td><strong data-start=\"572\" data-end=\"587\">Inheritance<\/strong><\/td>\n<td>A class can implement multiple interfaces (supports multiple inheritance)<\/td>\n<td>A class can extend only one abstract class<\/td>\n<\/tr>\n<tr data-start=\"712\" data-end=\"818\">\n<td><strong data-start=\"714\" data-end=\"730\">Constructors<\/strong><\/td>\n<td>Cannot have constructors<\/td>\n<td>Can have constructors<\/td>\n<\/tr>\n<tr data-start=\"819\" data-end=\"939\">\n<td><strong data-start=\"821\" data-end=\"841\">Access Modifiers<\/strong><\/td>\n<td>Methods are <code data-start=\"856\" data-end=\"864\">public<\/code> by default<\/td>\n<td>Methods can have any access modifier<\/td>\n<\/tr>\n<tr data-start=\"940\" data-end=\"1091\">\n<td><strong data-start=\"942\" data-end=\"951\">Usage<\/strong><\/td>\n<td>Defines a contract for implementation (behavior-focused)<\/td>\n<td>Used for code reuse and providing common behavior (blueprint-focused)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q8_What_are_the_core_Object-Oriented_Programming_OOP_concepts_in_Java\"><\/span><b><span data-contrast=\"auto\">Q8) What are the core Object-Oriented Programming (OOP) concepts in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a01) <\/span><b><span data-contrast=\"auto\">Encapsulation:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Definition:<\/span><\/b><span data-contrast=\"auto\"> Bundles data (variables) and methods (functions) together within a class, restricting direct access to some of the object&#8217;s components.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Purpose:<\/span><\/b><span data-contrast=\"auto\"> Enhances security and modularity by hiding internal implementation details using access modifiers (<\/span><span data-contrast=\"auto\">private<\/span><span data-contrast=\"auto\">, <\/span><span data-contrast=\"auto\">protected<\/span><span data-contrast=\"auto\">, <\/span><span data-contrast=\"auto\">public<\/span><span data-contrast=\"auto\">).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a02)\u00a0 <\/span><b><span data-contrast=\"auto\">Inheritance:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Definition:<\/span><\/b><span data-contrast=\"auto\"> Allows one class (subclass) to inherit fields and methods from another class (superclass).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Purpose:<\/span><\/b><span data-contrast=\"auto\"> Promotes code reusability and establishes a hierarchical relationship between classes.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a03)\u00a0 <\/span><b><span data-contrast=\"auto\">Polymorphism:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Definition:<\/span><\/b><span data-contrast=\"auto\"> Enables a single entity (method or object) to take on many forms.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Purpose:<\/span><\/b><span data-contrast=\"auto\"> Allows methods to perform differently based on the object calling them (method overloading and overriding), leading to more flexible and\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 maintainable code.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a04)\u00a0 <\/span><b><span data-contrast=\"auto\">Abstraction:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Definition:<\/span><\/b><span data-contrast=\"auto\"> Abstraction is one of the <a href=\"https:\/\/www.w3schools.com\/java\/java_oop.asp\">OOPs concepts<\/a> to hide certain details and show only essential information to the user.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a0 \u00a0Purpose:<\/span><\/b><span data-contrast=\"auto\"> Simplifies interaction with objects through abstract classes and interfaces, focusing on what an object does rather than how it does it.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q9_What_is_polymorphism_and_give_examples_from_your_automation\"><\/span><b><span data-contrast=\"auto\">Q9) What is polymorphism and give examples from your automation?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">Polymorphism is Object oriented concept where single action can be transformed into multiple forms<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0 <\/span><b><span data-contrast=\"auto\">Types:<\/span><\/b><span data-contrast=\"auto\"> Overloading (compile-time) and Overriding (run-time)<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0\u00a0\u00a0 <\/span> <b><span data-contrast=\"auto\">1) Overloading:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Same method name with different arguments<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Purpose:<\/span><\/b><span data-contrast=\"auto\"> simplify verbose<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Java examples<\/span><\/b><span data-contrast=\"auto\">: subString(int) \/\/ only start index and subString(int, int) \/\/ start and end<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Selenium examples:<\/span><\/b><span data-contrast=\"auto\"> switchTo().frame<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Framework examples<\/span><\/b><span data-contrast=\"auto\">: locateElement(String) -&gt; default by xpath, locateElement(String, String) -&gt; by any locator<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">\u00a0 \u00a02) Overriding:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Override the super class method behavior at sub class level<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Purpose:<\/span><\/b><span data-contrast=\"auto\"> when like override the functionality<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Java examples:<\/span><\/b><span data-contrast=\"auto\"> equals method in String class overrides the Object class<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Selenium examples:<\/span><\/b><span data-contrast=\"auto\"> quit method in ChromiumDriver overrides the quit method in RWD<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Framework examples:<\/span><\/b><span data-contrast=\"auto\"> BeforeMethod in registration testcase override the BeforeMethod at hooks level (default: login).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><strong><span class=\"TextRun SCXW161665735 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW161665735 BCX8\">You Might Also Like: <\/span><\/span><\/strong><a class=\"Hyperlink SCXW161665735 BCX8\" href=\"https:\/\/www.testleaf.com\/blog\/2025-top-automation-testing-infosys-interview-questions-with-expert-answers-from-testleaf-for-2-to-5-years-experience\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW161665735 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW161665735 BCX8\" data-ccp-charstyle=\"Hyperlink\">https:\/\/www.testleaf.com\/blog\/2025-top-automation-testing-infosys-interview-questions-with-expert-answers-from-testleaf-for-2-to-5-years-experience\/<\/span><\/span><\/a><span class=\"EOP SCXW161665735 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q10_Can_we_override_a_private_method_in_Java_Why_or_why_not\"><\/span><b><span data-contrast=\"auto\">Q10) Can we override a private method in Java? Why or why not?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">No, we cannot override a private method in Java.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Reason:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ol>\n<li><b><span data-contrast=\"auto\">Visibility:<\/span><\/b><span data-contrast=\"auto\"> Private methods are not visible to any subclasses. Since they are not inherited, a subclass cannot override them.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Method Shadowing:<\/span><\/b><span data-contrast=\"auto\"> If a subclass defines a method with the same signature as a private method in the superclass, it&#8217;s not overriding\u2014it&#8217;s simply creating a new method that exists independently in the subclass.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ol>\n<p><span data-contrast=\"auto\">Thus, overriding is only applicable to methods that are inherited (i.e., those with <\/span><span data-contrast=\"auto\">public<\/span><span data-contrast=\"auto\">, <\/span><span data-contrast=\"auto\">protected<\/span><span data-contrast=\"auto\">, or default access within the same package).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559731&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q11_Can_we_override_a_static_variable_in_Java\"><\/span><b><span data-contrast=\"auto\">Q11) Can we override a static variable in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">No, we cannot override a static variable in Java.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Explanation:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ol>\n<li><b><span data-contrast=\"auto\">Static Variables Belong to the Class:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">Static variables are associated with the class itself, not with instances of the class. They are resolved at compile time based on the reference type.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Overriding vs. Hiding:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">Overriding applies to instance methods where a subclass provides a new implementation for an inherited method. With static variables, if you declare a variable with the same name in a subclass, it does not override the parent variable; instead, it hides it. This is known as variable shadowing.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ol>\n<p><b><span data-contrast=\"auto\">Example:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> class Parent {<br \/>\nstatic int x = 10;<br \/>\n}<br \/>\nclass child extends Parent {<br \/>\n\/\/ This is not overriding; it&#8217;s hiding the static variable from Parent<br \/>\nstatic int x = 20;<br \/>\npublic class Test {<br \/>\npublic static void main(String[] args) {<br \/>\nSystem.out.println(Parent.x); \/\/ outputs: 10<br \/>\nSystem.out.println(Child.x); \/\/ Outputs: 20<br \/>\n}<br \/>\n}<\/span><\/p><\/blockquote>\n<p><span data-contrast=\"auto\">In this example, <\/span><span data-contrast=\"auto\">Child.x<\/span><span data-contrast=\"auto\"> hides <\/span><span data-contrast=\"auto\">Parent.x<\/span><span data-contrast=\"auto\">, but the original <\/span><span data-contrast=\"auto\">Parent.x<\/span><span data-contrast=\"auto\"> remains unchanged. This is why we say that static variables cannot be overridden.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q12_Can_we_declare_a_class_as_final_in_Java\"><\/span><b><span data-contrast=\"auto\">Q12) Can we declare a class as final in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">Yes, we can declare a class as final in Java.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Explanation:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">Final Class:<\/span><\/b><span data-contrast=\"auto\"> When a class is declared as final, it cannot be subclassed (extended). This means no other class can inherit from it.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Purpose:<\/span><\/b><span data-contrast=\"auto\"> This is used to prevent modification of the class&#8217;s behavior, which can be important for security, design stability, or performance reasons.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Example:<\/span><\/b><span data-contrast=\"auto\"> The <\/span><span data-contrast=\"auto\">String<\/span><span data-contrast=\"auto\"> class in Java is a well-known final class.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<blockquote><p>final class MyFinalClass {<br \/>\n\/\/ class members and methods<br \/>\n}<br \/>\n\/\/ The following code would result in a compilation error<br \/>\n\/\/ class Subclass extends MyFinalClass {}<\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"Q13_What_is_the_difference_between_an_Array_and_an_ArrayList_in_Java\"><\/span><b><span data-contrast=\"auto\">Q13) What is the difference between an Array and an ArrayList in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">Array:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">Fixed Size:<\/span><\/b><span data-contrast=\"auto\"> The size of an array is determined at the time of creation and cannot be changed.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Type:<\/span><\/b><span data-contrast=\"auto\"> Can store both primitive data types (e.g., int, char) and objects.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Performance:<\/span><\/b><span data-contrast=\"auto\"> Faster access to elements; less overhead.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Syntax:<\/span><\/b><span data-contrast=\"auto\"> Built into the language and uses special syntax.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">ArrayList:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">Dynamic Size:<\/span><\/b><span data-contrast=\"auto\"> The size of an ArrayList can grow or shrink dynamically as elements are added or removed.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Type:<\/span><\/b><span data-contrast=\"auto\"> Can only store objects (primitive types must be wrapped, e.g., <\/span><span data-contrast=\"auto\">Integer<\/span><span data-contrast=\"auto\"> for int).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Methods:<\/span><\/b><span data-contrast=\"auto\"> Comes with convenient methods like <\/span><span data-contrast=\"auto\">add()<\/span><span data-contrast=\"auto\">, <\/span><span data-contrast=\"auto\">remove()<\/span><span data-contrast=\"auto\">, and <\/span><span data-contrast=\"auto\">contains()<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Part of Collections:<\/span><\/b><span data-contrast=\"auto\"> It is part of the Java Collections Framework, offering many utility methods for handling collections.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><a href=\"https:\/\/ai-master-class.testleaf.com\/?utm_source=GenAI_Webinar&amp;utm_medium=Organic&amp;utm_campaign=GenAI_Webinar\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7642 size-full\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass.png\" alt=\"Gen AI Masterclass\" width=\"2048\" height=\"512\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass.png 2048w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-300x75.png 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-1024x256.png 1024w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-768x192.png 768w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-1536x384.png 1536w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-150x38.png 150w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/p>\n<h2><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"Q14_What_is_a_HashMap_in_Java_and_how_does_it_work\"><\/span><b><span data-contrast=\"auto\">Q14) What is a HashMap in Java, and how does it work?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">A <\/span><b><span data-contrast=\"auto\">HashMap<\/span><\/b><span data-contrast=\"auto\"> in Java is a part of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Java_collections_framework\">Java Collections Framework<\/a> that implements the <\/span><span data-contrast=\"auto\">Map<\/span><span data-contrast=\"auto\"> interface. It stores data in key-value pairs and provides fast retrieval based on the key.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Key Points:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ol>\n<li><b><span data-contrast=\"auto\">Structure: <\/span><\/b><span data-contrast=\"auto\">HashMap uses a hash table to store the data, where each key&#8217;s hash code determines its bucket location.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Key-Value Storage: <\/span><\/b><span data-contrast=\"auto\">Data is stored as key-value pairs. Keys must be unique, while values can be duplicated.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Null Values: <\/span><\/b><span data-contrast=\"auto\">It allows one null key and multiple null values.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Performance: <\/span><\/b><span data-contrast=\"auto\">Offers constant-time performance for basic operations (like <\/span><span data-contrast=\"auto\">get<\/span><span data-contrast=\"auto\"> and <\/span><span data-contrast=\"auto\">put<\/span><span data-contrast=\"auto\">) under typical conditions.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Order: <\/span><\/b><span data-contrast=\"auto\">It does not guarantee any specific order of elements.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Thread Safety: <\/span><\/b><span data-contrast=\"auto\">HashMap is not synchronized. For thread-safe operations, you can use <\/span><span data-contrast=\"auto\">Collections.synchronizedMap()<\/span><span data-contrast=\"auto\"> or <\/span><span data-contrast=\"auto\">ConcurrentHashMap<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ol>\n<p><b><span data-contrast=\"auto\">Program:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> import java.util.HashMap;<br \/>\nimport java.util.Map;<br \/>\npublic class HashMapExample {<br \/>\npublic static void main(String[] args) {<br \/>\n\/\/ Create a HashMap<br \/>\nMap&lt;String, Integer&gt; map = new HashMap&lt;&gt;();<br \/>\n\/\/ Add key-value pairs to the map<br \/>\nmap.put(&#8220;Apple&#8221;, 3);<br \/>\nmap.put(&#8220;Banana&#8221;, 5);<br \/>\nmap.put(&#8220;Orange&#8221;, 2);<br \/>\nmap.put(null, 10); \/\/ ALLowed: one null key<br \/>\n\/\/ Retrieve a value<br \/>\nSystem.out.println(&#8220;Number of Bananas: + map.get(&#8220;Banana&#8221;));<br \/>\n\/\/ Iterate over the map<br \/>\nfor (Map. Entry&lt;String, Integer&gt; entry: map.entrySet()) {<br \/>\nSystem.out.println(entry.getKey()+&#8221;-&gt;&#8221; + entry.getValue());<br \/>\n}<br \/>\n}<\/span><\/p><\/blockquote>\n<p><b><span data-contrast=\"auto\">Output Example:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> Number of Bananas: 5<br \/>\nApple -&gt;3<br \/>\nBanana -&gt;5<br \/>\nOrange -&gt;2<br \/>\nnull -&gt; 10<\/span><\/p>\n<p><strong><span class=\"TextRun SCXW61151225 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW61151225 BCX8\">Don\u2019t<\/span><span class=\"NormalTextRun SCXW61151225 BCX8\"> Miss Out:<\/span><\/span><\/strong> <a class=\"Hyperlink SCXW61151225 BCX8\" href=\"https:\/\/www.testleaf.com\/blog\/capgemini-interview-guide-questions-and-tips-to-ace-interview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW61151225 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW61151225 BCX8\" data-ccp-charstyle=\"Hyperlink\">https:\/\/www.testleaf.com\/blog\/capgemini-interview-guide-questions-and-tips-to-ace-interview\/<\/span><\/span><\/a><span class=\"EOP SCXW61151225 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q15_What_are_the_differences_between_an_ArrayList_and_a_LinkedList_in_Java\"><\/span><b><span data-contrast=\"auto\">Q15) What are the differences between an ArrayList and a LinkedList in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table width=\"738\">\n<tbody>\n<tr data-start=\"45\" data-end=\"195\">\n<td width=\"203\">Feature<\/td>\n<td width=\"212\">ArrayList<\/td>\n<td width=\"323\">LinkedList<\/td>\n<\/tr>\n<tr>\n<td width=\"203\">Data Structure<\/td>\n<td width=\"212\">Uses a dynamic array to store elements.<\/td>\n<td width=\"323\">Uses a doubly-linked list where each element is a node with pointers to the next and previous nodes.<\/td>\n<\/tr>\n<tr data-start=\"535\" data-end=\"704\">\n<td width=\"203\">Random Access<\/td>\n<td width=\"212\">Fast random access (O(1)) because elements are indexed.<\/td>\n<td width=\"323\">Slow random access (O(n)) since traversal is required from the beginning or end.<\/td>\n<\/tr>\n<tr data-start=\"705\" data-end=\"900\">\n<td width=\"203\">Insertion\/Deletion<\/td>\n<td width=\"212\">Slower for middle insertions or deletions due to shifting of elements (O(n)).<\/td>\n<td width=\"323\">Faster for insertions\/deletions at any position (O(1)) if the node reference is known.<\/td>\n<\/tr>\n<tr data-start=\"901\" data-end=\"1074\">\n<td width=\"203\">Memory Overhead<\/td>\n<td width=\"212\">Lower memory overhead as it stores only the element data.<\/td>\n<td width=\"323\">Higher memory overhead because each node stores additional pointers (prev and next).<\/td>\n<\/tr>\n<tr data-start=\"1075\" data-end=\"1335\">\n<td width=\"203\">Real-Time Example<\/td>\n<td width=\"212\">Ideal for storing a list of products in an e-commerce app where you frequently read data but rarely modify it.<\/td>\n<td width=\"323\">Perfect for managing a task scheduler or event queue in a chat application where tasks are frequently added or removed.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"Q16_What_is_the_difference_between_a_Set_and_a_List_in_Java\"><\/span><b><i><span data-contrast=\"none\">Q16<\/span><\/i><\/b><b><span data-contrast=\"auto\">) What is the difference between a Set and a List in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table width=\"738\">\n<tbody>\n<tr data-start=\"45\" data-end=\"226\">\n<td width=\"203\">Feature<\/td>\n<td width=\"212\">Set<\/td>\n<td width=\"323\">List<\/td>\n<\/tr>\n<tr>\n<td width=\"203\">Duplicates<\/td>\n<td width=\"212\">Does not allow duplicate elements.<\/td>\n<td width=\"323\">Allows duplicate elements.<\/td>\n<\/tr>\n<tr data-start=\"580\" data-end=\"756\">\n<td width=\"203\">Ordering<\/td>\n<td width=\"212\">No guaranteed order (unless using LinkedHashSet or TreeSet).<\/td>\n<td width=\"323\">Maintains insertion order (elements are stored sequentially).<\/td>\n<\/tr>\n<tr data-start=\"757\" data-end=\"932\">\n<td width=\"203\">Index Access<\/td>\n<td width=\"212\">No index-based access (cannot retrieve by position).<\/td>\n<td width=\"323\">Supports index-based access (can retrieve elements by index).<\/td>\n<\/tr>\n<tr data-start=\"933\" data-end=\"1111\">\n<td width=\"203\">Use Cases<\/td>\n<td width=\"212\">Useful when uniqueness is required (e.g., storing unique user IDs).<\/td>\n<td width=\"323\">Useful when order matters or duplicates are acceptable (e.g., a playlist).<\/td>\n<\/tr>\n<tr data-start=\"1112\" data-end=\"1286\">\n<td width=\"203\">Performance<\/td>\n<td width=\"212\">Typically offers faster search operations for unique elements.<\/td>\n<td width=\"323\">Better for scenarios where order-based access is needed.<\/td>\n<\/tr>\n<tr data-start=\"1287\" data-end=\"1477\">\n<td width=\"203\">Real-Time Example<\/td>\n<td width=\"212\">A system that stores unique email addresses.<\/td>\n<td width=\"323\">An e-commerce application\u2019s shopping cart that may contain multiple instances of the same product.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q17_What_are_the_commonly_used_classes_that_implement_the_List_and_Set_interfaces_in_Java\"><\/span><b><span data-contrast=\"auto\">Q17) What are the commonly used classes that implement the List and Set interfaces in Java?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">List:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">ArrayList:<\/span><\/b><span data-contrast=\"auto\"> Dynamic array with fast random access. <\/span><br \/>\n<b><\/b><\/li>\n<li><b><span data-contrast=\"auto\">LinkedList:<\/span><\/b><span data-contrast=\"auto\"> Doubly-linked list, efficient for insertions and deletions. <\/span><br \/>\n<b><\/b><\/li>\n<li><b><span data-contrast=\"auto\">Vector:<\/span><\/b><span data-contrast=\"auto\"> Legacy, synchronized version of ArrayList. <\/span><br \/>\n<b><\/b><\/li>\n<li><b><span data-contrast=\"auto\">Stack:<\/span><\/b><span data-contrast=\"auto\"> A subclass of Vector that implements a LIFO stack.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">Set:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">HashSet:<\/span><\/b><span data-contrast=\"auto\"> Unordered collection that stores unique elements using a hash table. <\/span><br \/>\n<b><\/b><\/li>\n<li><b><span data-contrast=\"auto\">LinkedHashSet:<\/span><\/b><span data-contrast=\"auto\"> Maintains insertion order. <\/span><br \/>\n<b><\/b><\/li>\n<li><b><span data-contrast=\"auto\">TreeSet:<\/span><\/b><span data-contrast=\"auto\"> Stores elements in sorted order (implements SortedSet).<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q18_What_are_the_return_types_of_getWindowHandle_and_getWindowHandles_in_Selenium_WebDriver_and_what_do_they_represent\"><\/span><b><span data-contrast=\"auto\">Q18) What are the return types of getWindowHandle() and getWindowHandles() in Selenium WebDriver, and what do they represent?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">getWindowHandle()<\/span><\/b><b><span data-contrast=\"auto\">:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Return Type:<\/span><\/b> <span data-contrast=\"auto\">String<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Represents:<\/span><\/b><span data-contrast=\"auto\"> The unique identifier (handle) of the current window.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Usage Example:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> String currentwindow = driver.getwindowHandle();<\/span><\/p>\n<p><b><span data-contrast=\"auto\">getWindowHandles()<\/span><\/b><b><span data-contrast=\"auto\">:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Return Type:<\/span><\/b> <span data-contrast=\"auto\">Set&lt;String&gt;<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Represents:<\/span><\/b><span data-contrast=\"auto\"> A set of unique identifiers (handles) for all open windows or tabs.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Usage Example:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/b><b><span data-contrast=\"auto\">\u00a0<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\"> Set&lt;String&gt; allwindows = driver.getWindowHandles();<\/span><\/p>\n<p><span data-contrast=\"auto\">getWindowHandle()<\/span><span data-contrast=\"auto\"> returns a single <\/span><span data-contrast=\"auto\">String<\/span><span data-contrast=\"auto\"> for the current window, while <\/span><span data-contrast=\"auto\">getWindowHandles()<\/span><span data-contrast=\"auto\"> returns a <\/span><span data-contrast=\"auto\">Set<\/span><span data-contrast=\"auto\"> of <\/span><span data-contrast=\"auto\">String<\/span><span data-contrast=\"auto\"> values representing all open windows, allowing you to iterate and switch between them.<\/span><\/p>\n<p><strong><span class=\"TextRun SCXW206173986 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW206173986 BCX8\">Continue Reading: <\/span><\/span><\/strong><a class=\"Hyperlink SCXW206173986 BCX8\" href=\"https:\/\/www.testleaf.com\/blog\/selenium-accenture-interview-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW206173986 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW206173986 BCX8\" data-ccp-charstyle=\"Hyperlink\">https:\/\/www.testleaf.com\/blog\/selenium-accenture-interview-questions\/<\/span><\/span><\/a><span class=\"EOP SCXW206173986 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Q19_x-path_axes_what_is_following_and_following_sibling\"><\/span><b style=\"font-style: inherit;\"><span data-contrast=\"auto\">Q19) x-path axes\/ what is following and following sibling<\/span><\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-contrast=\"auto\">\u00a0In XPath, axes help you navigate through an XML document relative to the context node. Two commonly used axes are <\/span><b><span data-contrast=\"auto\">following<\/span><\/b><span data-contrast=\"auto\"> and <\/span><b><span data-contrast=\"auto\">following-sibling<\/span><\/b><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Following Axis:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Definition:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">The <\/span><b><span data-contrast=\"auto\">following<\/span><\/b><span data-contrast=\"auto\"> axis selects all nodes in the document that occur after the current node, in document order, regardless of their depth or hierarchical level. It includes not only siblings but also nodes that are deeper in the document structure, if they appear after the closing tag of the current node.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Example:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">Consider the following XML:<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<blockquote><p>&lt;root&gt;<br \/>\n&lt;a&gt;First&lt;\/a&gt;<br \/>\n&lt;b&gt;Second&lt;\/b&gt;<br \/>\n&lt;C&gt;<br \/>\n&lt;d&gt;Third&lt;\/d&gt;<br \/>\n&lt;\/c&gt;<br \/>\n&lt;\/root&gt;<\/p><\/blockquote>\n<p><span data-contrast=\"auto\">If your context node is &lt;a&gt;, then the expression following::node() would select &lt;b&gt;, &lt;c&gt;, and &lt;d&gt; because all these nodes appear after &lt;a&gt; in document order.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<h5><b><span data-contrast=\"auto\">Following-Sibling Axis:<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<p><b><span data-contrast=\"auto\">Definition:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">The <\/span><b><span data-contrast=\"auto\">following-sibling<\/span><\/b><span data-contrast=\"auto\"> axis selects only those nodes that share the same parent as the current node and appear after it. It does not traverse into the descendants of these siblings.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Example:<\/span><\/b><br \/>\n<span data-contrast=\"auto\">Using the same XML as above, if your context node is &lt;a&gt;, the expression following-sibling::* would select &lt;b&gt; and &lt;c&gt;, but not &lt;d&gt; because &lt;d&gt; is a child of &lt;c&gt;, not a sibling of &lt;a&gt;.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<h3 aria-level=\"3\"><b><span data-contrast=\"auto\">What\u2019s Next?<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:281,&quot;335559739&quot;:281,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">We\u2019ve covered 19 important questions in this blog post, but there\u2019s more to explore! Stay tuned for <\/span><a href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers-2\/\"><b><span data-contrast=\"auto\">Part 2<\/span><\/b><\/a><span data-contrast=\"auto\">, where we\u2019ll dive into <\/span><b><span data-contrast=\"auto\">19 more essential questions<\/span><\/b><span data-contrast=\"auto\"> to further enhance your knowledge.<\/span><\/p>\n<h5><\/h5>\n<h5><strong>We Also Provide Training In:<\/strong><\/h5>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/selenium-automation-certification-training-course.html?utm_source=blog_post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Advanced Selenium Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/playwright.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Playwright Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/genai-qa-engineers-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Gen AI Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/aws-cloud-architect-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>AWS Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/rest-api-testing-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>REST API Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/full-stack-developer-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Full Stack Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/appium-mobile-automation-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Appium Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/dev-ops-master-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>DevOps Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/apache-jmeter-testing-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>JMeter Performance Training<\/strong><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h6><strong>Author&#8217;s Bio<\/strong>:<\/h6>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2404 alignleft\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2023\/04\/Untitled-design.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2023\/04\/Untitled-design.png 250w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2023\/04\/Untitled-design-150x150.png 150w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2023\/04\/Untitled-design-96x96.png 96w\" sizes=\"(max-width: 250px) 100vw, 250px\" \/><\/p>\n<p>As CEO of TestLeaf, I\u2019m dedicated to transforming software testing by empowering individuals with real-world skills and advanced technology. With 24+ years in software engineering, I lead our mission to shape local talent into global software professionals. Join us in redefining the future of test engineering and making a lasting impact in the tech world.<\/p>\n<p><strong>Babu Manickam<\/strong><\/p>\n<p>CEO &#8211; Testleaf<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"https:\/\/in.linkedin.com\/in\/babu-manickam\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/linkedin.png\" alt=\"LinkedIn Logo\" width=\"28\" height=\"28\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Epam Interview Questions: Part 1 Introduction\u00a0 Preparing for an EPAM interview? In this blog post, we\u2019ll break down some of the most common EPAM interview questions\u2014covering everything from explaining your automation framework to solving real-world coding challenges. Whether you&#8217;re a seasoned automation engineer or just starting your journey, these insights will help you showcase your &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.testleaf.com\/blog\/epam-interview-questions-with-answers\/\"> <span class=\"screen-reader-text\">EPAM Interview Questions with Answers<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4203,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[17,62,113],"tags":[157,65,126],"class_list":["post-4201","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automation-coverage-productivity","category-interview-questions","category-java","tag-interview-preparation","tag-interview-questions","tag-java-interview-questions"],"acf":[],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts\/4201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/comments?post=4201"}],"version-history":[{"count":18,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts\/4201\/revisions"}],"predecessor-version":[{"id":8138,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts\/4201\/revisions\/8138"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/media\/4203"}],"wp:attachment":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/media?parent=4201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/categories?post=4201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/tags?post=4201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}