This is "mastermind", and
you should be able to find lots of examples of this on the internet. But I would say you would need to use the String.charAt() function in a loop to look at each letter.
for each letter, but not bigger than the length of the shorter string,
if secret one matched guess at same place
add one to your 'perfect' counter
remove the letter from both (so not to second count it)
back-off the counter by one, since you removed the letter
else if this secret letter matched anywhere in the guess (indexOf()>-1)
add one to your 'wrong position' counter
So String.substring(0,i) will take the first i characters of the string, and String.substring(i+1) will start at i+1 and go to the end. String.charAt(i) will give you a character you can compare.
--Dale--