Print message without main method in java.


Here i am gonna show you how you can print message without main method and without executing your java program.

You just need to do is to write the program in your text-editor and compile it using javac in command-prompt.

 class con
 {
 String s="\n\n\n\n\n\n\n\n\nI am in coding page\n\n\n\n\n\n\n";
 }

Save it with any file name but other than con
For example you can save it with demo.java

Compile it  javac demo.java


After compiling your code you will get a output like this.





Comments

Popular posts from this blog

How to install NASM and compile Assembly program in kali linux.

JAVA PROGRAM TO REVERSE THE ARRAY ELEMENT.

Java program to draw pattern of Indian Map