I am completely new to programming (java) and our teacher asks us to make some excercises in my programming lab.
Now I can't seem to find out how to write the correct method. This is the question: Write a method max that has two string parameters and returns the larger of the two.
I have
String string1, string2;
public max Strings(string1.length(), string2.length())
{
if (string1.length()>string2.length)
{
return string1;
else if (string1.length()<string2.length)
return string2;
}
}