Back to Browse

Automation Testing Mock Interview| Test Plan, Selenium Framework, Advance JAVA Collections| 4+ YOE

1.1K views
Feb 14, 2021
35:38

What is the difference between HashSet and HashMap? The differences between the HashSet and HashMap are listed below. HashSet contains only values whereas HashMap includes the entry (key, value). HashSet can be iterated, but HashMap needs to convert into Set to be iterated. HashSet implements Set interface whereas HashMap implements the Map interface HashSet cannot have any duplicate value whereas HashMap can contain duplicate values with unique keys. Can we Override Private Method in Java? No, you cannot override private methods in Java, private methods are non-virtual in Java and access differently than non-private one. Since method overriding can only be done on derived class and private methods are not accessible in a subclass, you just can not override them. 3. Fundamental difference between List and Set in Java List in Java allows duplicates while Set doesn't allow any duplicate List is an Ordered Collection while Set is an unordered Collection. Set uses equals() method to check uniqueness of elements stored in Set, while SortedSet uses compareTo() method to implement natural sorting order of elements. Q4. What is the difference between Absolute Path and Relative Path? Absolute XPath starts from the root node and ends with desired descendant element’s node. It starts with top HTML node and ends with input node. It starts with a single forward slash(/) as shown below. /html/body/div[3]/div[1]/form/table/tbody/tr[1]/td/input 1 /html/body/div[3]/div[1]/form/table/tbody/tr[1]/td/input Relative XPath starts from any node in between the HTML page to the current element’s node(last node of the element). It starts with a double forward slash(//) as shown below.

Download

0 formats

No download links available.

Automation Testing Mock Interview| Test Plan, Selenium Framework, Advance JAVA Collections| 4+ YOE | NatokHD