We need a main method for executing a program.
But YES we can write a program without using main() method.
TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.
TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main method
Whoa!!!!! we are done.
;)
How to write a program for secant method by mathematica
sdfdg
This is not a question.
When you start your xxxx.class it will execute its 'public static void main (String args[])' method. Any other main methods won't be executed, only if your program explicitly calls them.
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
How to write a program for secant method by mathematica
i need this answer
sdfdg
Technically yes, practically no.
This is not a question.
not possible dude
To swap two variables without using a third variable, use exclusive or manipulation... a ^= b; b ^= a; a ^= b;
a=a^b; b=a^b; a=a^b;
Certainly, you can write a program without main, but you cannot build an executable from it, if that is okay with you.
When you start your xxxx.class it will execute its 'public static void main (String args[])' method. Any other main methods won't be executed, only if your program explicitly calls them.
write a sample program using asp.net explaining all the syntax and semantics of the program
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?