I have this code,
class Test
{
public static void main(String args[])
{
String x = "Hello";
String y = "Bye!";
System.out.printf("This is %s, this is %s", x);
}
}
And the the java compiler compiled it, but it obviously has an error. My question is, why didn't the compiler catch this error? Where's the benefit of static typing if it can't even catch this small mistake?