Is an empty .java file name a valid source file name?

Is an empty .java file name a valid source file name?

You can have .java file withought any name . you have to compile it by javac .java(it compile successfuly) and run it by java clasnname.(so you must provide a class name)



class withoutname
{
         public static void main(String argsp[])
         {
                       System.out.prinln("BCA School Jamangar....!");
         }
}


save it   without name   .java 

compile javac .java

run  java withoutname(class name)





Post a Comment

Thanks for comment.

Previous Post Next Post