[Logo]
Forums Register Login
main
can we call main method from any other method or any other part of the code?
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:
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS


This thread has been viewed 358 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 22, 2018 05:44:09.