Forums Register Login

In which pakage or class is the java main method

+Pie Number of slices to send: Send
hello there

i want to know in which package or class is the java main method is in. Tell me the hyararchy, in which it is. And also i want to know whether the main method can be revoked in another method without the static modifier. plz reply me, for i am stuck here with this.

thanks
jeyakanth
+Pie Number of slices to send: Send
When you write a Java program, you write the main() method. The JVM launcher program (which is written in C, not in Java) finds your class and invokes main(). Does this answer your question?
+Pie Number of slices to send: Send
 


i want to know in which package or class is the java main method is in


The main method is in whichever class you put it in.


And also i want to know whether the main method can be revoked in another method without the static modifier.


You can call static methods in a non-static way (i.e. by creating an instance and calling the method on that instance), if you want to. You shouldn't though (that is, assuming by 'revoked' you mean 'invoked').
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 661 times.
Similar Threads
How Elegant Is This Solution? Can You Offer Me Recommendations?
methods, instances and arrays - swimming in the ocean of java
public static void main method
public static void main(String agrs[])
calling of main()
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:52:49.