Forums Register Login

main

+Pie Number of slices to send: Send
can we call main method from any other method or any other part of the code?
+Pie Number of slices to send: Send
Sure. Main is just a public static method like any other.
In general, though, it's not usually a particularly good idea. A much better approach is usually to write a method which takes appropriate parameters and does what you want. Then you can call that from main, and from wherever else you want:
rubbery bacon. crispy 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 448 times.
Similar Threads
how to start 'main' of a servlet
Mock Green Exam1 Question clarification
is it possible 2 call a main method
calling main
Basic Question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:53:08.