Neither of your statements should compile: you are using the Generic List keyword without specifying a Type inside angle-brackets.
Also, even if you had correctly specified a Generic List return Type, both examples would not compile because there is no "return path" inside the body of the method which returns the expected Type.
If you wrote this:
public static List<int> getproduct()
{
return new List<int> {1,2,3};
}
static public List<string> getproduct()
{
return new List<string> {"a", "b"};
}
You'd also get an error because you have defined two methods with the same name and
identical parameter specifications (in this case: no parameters).
Except for rare cases, like Class constructor overloading, it's a good idea to use unique and descriptive names for methods !
The term "mnemonic" is used to describe a field, property, method, Class name, etc., that helps you immediately understand what it represents ... or what it is for, or how it's used.
And, yes: .NET allows you to re-order the use of the 'static modifier as you wish, but: you can use only one "protection" modifier ! But ... go figure ... this will compile:
internal static protected void doNothing()
{
}
I strongly suggest you study the accessibility modifiers individually: public, private, internal, protected, etc. [
^]