Is it a correct Java program? So will it compile and run without exceptions?
Please give an answer and explain ;-)
[If nobody will give an answer I will ;-)]
Similar postsbetaOpenOffice.org2GoogleDocs 1.0.4PixelbookChrome OS and JavaMath is stupid....I'm on Twitter ;-)
OK, nobody tried to give answer ;-) [but on my Polish blog first answer was correct ;-)]
ReplyDeleteIn short, this program is correct - will compile and run without problems.
Why? Java can distingish role of identificators base on language grammar.
public String String(String String) { return String; }
is correct because Java knows that first usage of String means type of return, second is method name, third is parameter type, forth is variable name, and fifth is again variable name. It's because proper method declaration is described as:
accessModifier returnType methodName(argumentType_opt argumentName_opt)
Trick in this code is usage of popular class names, most of us tread those as keywords ;-)