I was around Wikipedia reading about a programming language called 'D', it is the first time I read about it.
It was curious to me that the syntax looks very similar to Java. But most interesting was when I saw their main method uses char[][].
I opened up Eclipse and I tried this:
public static void main(char [][] args){
}
I was surprised when I saw it compiled with no syntax errors, but I did not understand why.
Can someone explain to me why this call to the main method can compile in Java?
As what you have written is valid Java syntax (static void method with name main and as argument a two dimensional char array) it will compile. The problem however is, that this main method will not work as entry point to a Java program, as this has to have the signature:public static void main(String[] args)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With