Reverse each word’s characters in string Answer: import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter Original string : ");
String originalStr = s.nextLine();
s.close();
String words[] = originalStr.split("\\s");
String reversedString = "";
for (int i = 0; i<words.length; i++)
{
String word = words[i];
String reverseWord = "";
for (int j = word.length()-1; j>=0; j--)
{
reverseWord = reverseWord + word.charAt(j);
}
reversedString = reversedString + reverseWord + " ";
}
// Displaying the string after reverse
System.out.print("Reversed string : " + reversedString);
}
} Output: Enter Original string : Today's Date is 23 June 2022
Reversed string : s'yadoT etaD si 32 enuJ 2202
public class Main
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter Original string : ");
String originalStr = s.nextLine();
s.close();
String words[] = originalStr.split("\\s");
String reversedString = "";
for (int i = 0; i<words.length; i++)
{
String word = words[i];
String reverseWord = "";
for (int j = word.length()-1; j>=0; j--)
{
reverseWord = reverseWord + word.charAt(j);
}
reversedString = reversedString + reverseWord + " ";
}
// Displaying the string after reverse
System.out.print("Reversed string : " + reversedString);
}
} Output: Enter Original string : Today's Date is 23 June 2022
Reversed string : s'yadoT etaD si 32 enuJ 2202
👍17
Reverse the words in string Answer: import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter Original string : ");
String originalStr = s.nextLine();
s.close();
String words[] = originalStr.split("\\s");
String reversedString = "";
//Reverse each word's position
for (int i = 0; i < words.length; i++)
{
if (i == words.length - 1)
reversedString = words[i] + reversedString;
else
reversedString = " " + words[i] + reversedString;
}
// Displaying the string after reverse
System.out.print("Reversed string : " + reversedString);
}
} Output: Enter Original string : Today's Date is 11dec 2023
Reversed string : 2023 dec 12 is Date Today's
public class Main
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter Original string : ");
String originalStr = s.nextLine();
s.close();
String words[] = originalStr.split("\\s");
String reversedString = "";
//Reverse each word's position
for (int i = 0; i < words.length; i++)
{
if (i == words.length - 1)
reversedString = words[i] + reversedString;
else
reversedString = " " + words[i] + reversedString;
}
// Displaying the string after reverse
System.out.print("Reversed string : " + reversedString);
}
} Output: Enter Original string : Today's Date is 11dec 2023
Reversed string : 2023 dec 12 is Date Today's
👍24🔥2🥰1😁1
What is Selenium WebDriver
Ans:
Selenium WebDriver is a tool for writing automated tests of websites. It is an API name and aims to mimic the behavior of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated.
Ans:
Selenium WebDriver is a tool for writing automated tests of websites. It is an API name and aims to mimic the behavior of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated.
👍5