{"id":1298,"date":"2021-11-04T18:49:56","date_gmt":"2021-11-04T18:49:56","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/?p=1298"},"modified":"2021-11-30T18:45:31","modified_gmt":"2021-11-30T18:45:31","slug":"sdet-interview-questions-part-4","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2021\/11\/04\/sdet-interview-questions-part-4\/","title":{"rendered":"Sr.QA and SDET Interview Questions in Java &#8211; Part 4"},"content":{"rendered":"<h3 id=\"t-1636050905349\"><a name=\"_Toc82204592\" style=\"outline: none;\">1. What is Typecasting explain with small code snippet?<\/a><\/h3>\n<ul>\n<li>Typecasting is converting data from one data type to another data type.<\/li>\n<li>Typecasting can be applied to both primitive and non-primitive types.<\/li>\n<li>Typecasting process doesn&#8217;t alter the data but alters the type.<\/li>\n<\/ul>\n<p><strong>There are two types:<\/strong><\/p>\n<ul>\n<li>Implicit casting<\/li>\n<li>Explicit casting<\/li>\n<\/ul>\n<p><strong>Implicit casting: <\/strong>This is known as automatic typecasting. Usually, this happens when you converting a lower data type to a higher data type<\/p>\n<p><strong> <\/strong><\/p>\n<p><strong>Example Code Snippet<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String args[]) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int i = 10;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float f = i;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&#8220;Value of f = &#8221; +f);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p style=\"\"><span style=\"\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">Value of f = 10.0<\/span><\/p>\n<p><strong>Explicit TypeCasting<\/strong><\/p>\n<p>Explicit casting involves assigning a data type of high range to a lower range. This casting needs to be done manually<\/p>\n<p><strong> <\/strong><\/p>\n<p><strong>Example Code Snippet<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String args[]) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float f = 3.142f;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp; i = (int) f;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&#8220;Value of i = &#8221; +i);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p style=\"\"><span style=\"\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">Value of i = 3<\/span><\/p>\n<p><em><strong>Note: <\/strong>Why do we need typecasting?<\/em><\/p>\n<p><em>Typecasting is needed to get access to fields and methods declared on the target type or class. You cannot access them with any other type.<\/em><\/p>\n<h3 id=\"t-1636050905350\"><a name=\"_Toc82204593\" style=\"outline: none;\">2. Write a program to reverse a string &nbsp;without using string.reverse() method<\/a><\/h3>\n<p><strong>Example Code Snippet<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String args[]) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String string = &#8220;Rahul Shetty Academy&#8221;;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String reverse = &#8220;&#8221;;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = string.length() &#8211; 1; i &gt;= 0; &#8211;i) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reverse += string.charAt(i);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(reverse);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p style=\"\"><span style=\"\">Output: ymedacA yttehS luhaR<\/span><\/p>\n<h3 id=\"t-1636050905351\"><a name=\"_Toc82204594\" style=\"outline: none;\">3. Write a program to calculate the occurrences of each character in the string<\/a><\/h3>\n<p><strong>Solution:<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">import java.util.*;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; static void countChars(String string) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HashMap&lt;Character, Integer&gt; charCount = new HashMap&lt;Character, Integer&gt;();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] charArray = string.toCharArray();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (char c : charArray) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (charCount.containsKey(c)) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charCount.put(c, charCount.get(c) + 1);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charCount.put(c, 1);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Map.Entry entry : charCount.entrySet()) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&#8220;Character &#8220;+entry.getKey() + &#8221; Occurred &#8221; + entry.getValue() +&#8221; Time(s)&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; countChars(&#8220;java&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p><span style=\"color: rgb(49, 211, 27);\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(49, 211, 27);\">Character a Occurred 2 Time(s)<\/span><\/p>\n<p><span style=\"color: rgb(49, 211, 27);\">Character v Occurred 1 Time(s)<\/span><\/p>\n<p><span style=\"color: rgb(49, 211, 27);\">Character j Occurred 1 Time(s)<\/span><\/p>\n<h3 id=\"t-1636050905352\"><a name=\"_Toc82204595\" style=\"outline: none;\">4. Write a program to check the magic number<\/a><\/h3>\n<p>The number is called a <strong>Magic number<\/strong>, If the sum of its digits is calculated till a single digit recursively by adding the sum of the digits after every addition. If the single-digit comes out to be 1, then the number is a magic number.<\/p>\n<p><strong>Example 1:<\/strong><\/p>\n<p>Number: 1081<\/p>\n<p>1081 = 1+0+8+1 Sum is 10<\/p>\n<p>10 = 1+0 Sum 1<\/p>\n<p>So 1081 is Magic number<\/p>\n<p><strong>Example 2:<\/strong><\/p>\n<p>Number: 1056<\/p>\n<p>1056 = 1+0+5+6 Sum is 12<\/p>\n<p>12 = 1+2 Sum is 3<\/p>\n<p>So 1056 is not a Magic number<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int sum = 0;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int number = 1081;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int n = number;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (n &gt; 0 || sum &gt; 9) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (n == 0) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n = sum;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sum = 0;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sum += n % 10;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n \/= 10;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (sum == 1) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(number + &#8221; is a Magic Number&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(number + &#8220;is not a Magic Number&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p><span style=\"color: rgb(40, 187, 67);\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(40, 187, 67);\">1081 is a Magic Number<\/span><\/p>\n<h3 id=\"t-1636050905353\"><a name=\"_Toc82204596\" style=\"outline: none;\">5. Write a program to check if two strings are an anagram<\/a><\/h3>\n<p>An anagram is if two strings are having exactly the same chars and however the order of chars are different.<\/p>\n<p><strong>Example 1:<\/strong><\/p>\n<p>String 1 = ABCD<\/p>\n<p>String 2: BDCA<\/p>\n<p>The String 1 and String 2 are anagrams<\/p>\n<p><strong>Example 2:<\/strong><\/p>\n<p>String 1: Race<\/p>\n<p>String 2: Care<\/p>\n<p>String 1 and String 2 are anagrams<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">import java.util.*;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">public class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String string1 = &#8220;race&#8221;;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String string2 = &#8220;care&#8221;;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean isAnagram = false;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (string1.length() != string2.length()) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isAnagram = false;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; else{<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] char1 = string1.toCharArray();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] char2 = string2.toCharArray();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Arrays.sort(char1);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Arrays.sort(char2);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; char1.length; i++) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (char1[i] != char2[i]) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isAnagram = false;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isAnagram = true;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (isAnagram)<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(string1 + &#8221; and &#8220;+string2+ &#8221; are Anagram&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(string1 + &#8221; and &#8220;+string2+ &#8221; are Not Anagram&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p><span style=\"color: rgb(66, 208, 27);\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(66, 208, 27);\">race and care are Anagram<\/span><\/p>\n<h3 id=\"t-1636050905354\"><a name=\"_Toc82204597\" style=\"outline: none;\">6. Write a program to create a deadlock in java<\/a><\/h3>\n<p><strong>Deadlock<\/strong> is the situation when a first thread is waiting for an object, that is acquired by a second thread and the second thread is waiting for an object lock that is acquired by the first thread. Since both threads are waiting for each other to release the lock. This condition is called deadlock.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object resource1 = new Object();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object resource2 = new Object();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread t1 = new Thread() {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void run() {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronized (resource1) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; System.out.println(&#8220;Thread 1: locked resource 1&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; try {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; Thread.sleep(100);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; } catch (Exception e) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; synchronized (resource2) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; System.out.println(&#8220;Thread 1: locked resource 2&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread t2 = new Thread() {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void run() {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronized (resource2) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; System.out.println(&#8220;Thread 2: locked resource 2&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; try {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; Thread.sleep(100);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; } catch (Exception e) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; synchronized (resource1) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; System.out.println(&#8220;Thread 2: locked resource 1&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&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; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t1.start();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t2.start();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p><span style=\"color: rgb(38, 211, 48);\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(38, 211, 48);\">Thread 1: locked resource 1<\/span><\/p>\n<p><span style=\"color: rgb(38, 211, 48);\">Thread 2: locked resource 2<\/span><\/p>\n<h3><a name=\"_Toc82204598\" style=\"outline: none;\">7. Consider I have data like below distance to the city from your hometown<\/a><\/h3>\n<p>Bangalore, 560<\/p>\n<p>Chennai, 890<\/p>\n<p>Hyderabad, 566<\/p>\n<p>Mumbai, 788<\/p>\n<p>New Delhi, 1000<\/p>\n<p>Write a program that stores the above data in Map, and print them back by iterating over each element.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">import java.util.HashMap;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">import java.util.Map;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">import java.util.Map.Entry;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">class Main {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Map&lt;String,Integer&gt; map = new HashMap&lt;String,Integer&gt;();<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.put(&#8220;Bangalore&#8221;, 560);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.put(&#8220;Chennai&#8221;, 890);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.put(&#8220;Hyderabad&#8221;, 566);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.put(&#8220;Mumbai&#8221;, 788);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.put(&#8220;New Delhi&#8221;, 1000);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(Entry&lt;String,Integer&gt; entry:map.entrySet()) {<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&#8220;Distance from Hometown to &#8221; + entry.getKey()+&#8221; is &#8221; + entry.getValue()+&#8221; Kms&#8221;);<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p><span style=\"color: rgb(255, 255, 255);\">}<\/span><\/p>\n<p><span style=\"color: rgb(43, 201, 33);\">Output:<\/span><\/p>\n<p><span style=\"color: rgb(43, 201, 33);\">Distance from Hometown to New Delhi is 1000 Kms<\/span><\/p>\n<p><span style=\"color: rgb(43, 201, 33);\">Distance from Hometown to Chennai is 890 Kms<\/span><\/p>\n<p><span style=\"color: rgb(43, 201, 33);\">Distance from Hometown to Mumbai is 788 Kms<\/span><\/p>\n<p><span style=\"color: rgb(43, 201, 33);\">Distance from Hometown to Hyderabad is 566 Kms<\/span><\/p>\n<p><span style=\"color: rgb(43, 201, 33);\">Distance from Hometown to Bangalore is 560 Kms<\/span><\/p>\n<h5 style=\"text-align: center;\"><em><span style=\"text-decoration: underline;\">Course Alert<\/span><\/em><\/h5>\n<p><strong>If you are interested in landing a SDET or Sr. QA Automation Engineer role, check out our popular SDET course to learn the fundamental skills required an SDET needs to perform at work. Also, I have another popular course which covers Top 150+ Interview questions most commonly asked in SDET \/ Automation interviews.<\/strong><\/p>\n<ul>\n<li><span><a href=\"https:\/\/courses.rahulshettyacademy.com\/p\/sdet-test-architect-essentials-road-to-full-stack-qa\" target=\"_blank\" style=\"outline: none;\" rel=\"noopener noreferrer\">SDET\/Test Architect Essentials -Road to Full stack QA<\/a><\/span><\/li>\n<li><span><a href=\"https:\/\/courses.rahulshettyacademy.com\/p\/sdet-qa-automation-interview-kit-java-logic-programs\" target=\"_blank\" style=\"outline: none;\" rel=\"noopener noreferrer\">SDET\/QA Automation Interview Kit + Java logic Programs<\/a><\/span><\/li>\n<\/ul>\n<h4><em><strong>A Quick Note<\/strong><\/em><\/h4>\n<p>Please remember all these courses comes with <strong>100% Lifetime acces<\/strong><strong>s<\/strong> and <strong>free updates for Lifetime!!<\/strong><\/p>\n<p>Please click on the link&nbsp;<strong><em><a href=\"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2021\/11\/04\/sdet-interview-questions-part-5\/\" target=\"_blank\" style=\"outline: none;\" rel=\"noopener noreferrer\">Sr.QA and SDET Interview Questions in Java \u2013 Part 5<\/a><\/em><\/strong> to continue to part-5 series of this article.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. What is Typecasting explain with small code snippet? Typecasting is converting data from one data type to another data type. Typecasting can be applied to both primitive and non-primitive types. Typecasting process doesn&#8217;t alter the data but alters the type. There are two types: Implicit casting Explicit casting Implicit casting: This is known as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1299,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-1298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview-questions","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1298"}],"version-history":[{"count":10,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1298\/revisions"}],"predecessor-version":[{"id":1363,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1298\/revisions\/1363"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/1299"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}