Output two similar length strings that have the same letters in their letter count.
Is there a website I can view to learn to do this? I tried searching but counldn't find anything.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Output two similar length strings that have the same letters in their letter count.
Is there a website I can view to learn to do this? I tried searching but counldn't find anything.
Why not give it a try yourself? This is a fundamental aspect of programming - problem solving. Break the problem down, how would you do this by hand? Write it out on paper, then translate to code. Make use of the java API, for example the String class.Is there a website I can view to learn to do this?
Should I change both strings into array, then check the array index in a for statement? The problem is that there are a lot of scripts that I have not seen before and I am sure there is a particular one for this problem.
import java.util.*;
public class indexofcoincedence
{public static void main (String[] args)
{
int len1=0; int len2=0;
Scanner input = new Scanner(System.in);
System.out.println( "Enter a word");
String word1 = input.nextLine();
System.out.println( "Enter a word");
String word2 = input.nextLine();
len1=word1.length();
len2=word2.length();
while (len1==len2)
{
}
}
}
Evidently I'm wasting my time here. Anywhere else you posted that you would like to disclose?
This thread has been cross posted here:http://www.java-forums.org/new-java/50550-need-help-index-coincedence.html
Although cross posting is allowed, for everyone's benefit, please read:
Sorry, I was just trying to get the quickest reply as possible.