Hi,
I am doing a project in java which I won�t go in detailed about at the mo. So the question is how I can use the substring method to compute substrings of a string, which is not in a string format. I will show the code to allow you to make sense of the problem.
public class Names{
String Name;
public Names (String notation)
{
Name = notation;
}
String sub = Name.substring(0,3);
public String Suit ()
{
double club;
if (sub == "Joe")
{
}
return "Bloggs";
}
}
As you can see from the code I want to use the variable �Name� as a string in the substring method.
Can anyone tell me if this correct? Or can it be done?
NP:
I will be using a NamesTest.java to enter the text Joe so that notation = �Joe� and
Name = notation.