SUNIL GUTTA

SUNIL GUTTA

  • NA
  • 1k
  • 394.2k

Static Main Block doubt??

May 23 2013 10:46 PM
Hie friends

Below is my sample code with no main method when tried to execute it's throwing an exception lol it will i too know that 


But the thing in java[JVM] many says after executing static blocks the after it looks for main if no main then after it throws an exception ?? right .. IF happens so as java , c# both are related OOPL's where in c# why am i not getting o/p before exception were as i am getting o/p i.e hiee from sunil in case of java under JVM ??


class Sunil
{
static  void sayhello()
{
System.Console.WriteLine("hie from sunil");

}



Hope you got my point ?


THANK YOU

Answers (6)