Sunday, January 27, 2019

package seleniumrepo;

import java.util.Arrays;
/*
 * Check whether two strings are anagram of each other
 * Ex: LISTEN <=> SILENT, TRIANGLE <=> INTEGRAL, HEART <=> EARTH
 */
public class Anagram {
public static void main(String[] args) {
String s="LISTEN";
String s1="SILENT";
char[] ch=s.toCharArray();
char[] ch1=s1.toCharArray();
Arrays.sort(ch);
Arrays.sort(ch1);
if(Arrays.equals(ch, ch1)){
                   System.out.println("True - Given number is words are anagrom of each other");
}else{
                   System.out.println("False - Given number is words are not anagrom of each other");
              }
}
}

Related Posts:

  • pom.xml in Maven A Project Object Model or POM is the fundamental unit of work in Maven. It contains the project configuration details used by Maven. Some of the configuration that can be specified in the POM are the project dependencies, th… Read More
  • Remove Duplicate values from an Array Write a Java Program to remove duplicate values from an array? package seleniumrepo; public class DisticntElements {     public static void printDistinctElements(int[] arr){         for(int i=… Read More
  • Palindrome Number Program in Java Palindrome Number: A Palindrome number is a number that remains the same when its digits are reversed. We get total 90 numbers between 100 and 1000. public class PalindromeNumber { public static void main(String[] a… Read More
  • @FindBy, @FindBys, @FindAll, @CacheLookup - Selenium API All are used to mark a field in a page object. @FindBy: It is an alternative mechanism for locating the element or a list of elements. Used in conjunction with PageFactory this allows users to quickly and easily cre… Read More
  • Why we require a separate browser executable file to launch a browser in selenium? It is very frequently asked interview question for me. I was no answer as till now we know only we need drivers( like chromedriver.exe, geckodriver.exe, IEDriverServer.exe) and pass them to the System.setProperty() to… Read More

0 comments:

Post a Comment

Selenium Training in Realtime

Blog helps to a student or IT employee to develop or improve skills in Software Testing.

Followers

About Me

My photo
Hyderabad, Andhra Pradesh, India
I am Automation Testing Professional. I have completed my graduation in B.Tech (Computers) from JNTU Hyderabad and started my career in Software Testing accidentally since then, I passionate on learning new technologies

Contact Form

Name

Email *

Message *

Popular Posts