Search:

Type: Posts; User: Tsarin

Search: Search took 0.30 seconds.

  1. Replies
    5
    Views
    1,946

    Re: How do I call a method from the main method?

    Have a go at using the examples to call method1, let me know how you go :)
  2. Replies
    5
    Views
    1,946

    Re: How do I call a method from the main method?

    You use the method name, followed by parenthesis "()". You put arguments in the brackets, separated by a comma.

    A method is made up of several parts, lets look at:



    public void...
  3. Replies
    5
    Views
    1,946

    Re: How do I call a method from the main method?

    You us the method name and argument pattern to refer to it, e.g:



    public static void main(String[] args){

    //Will work
    someMethod("Hello World");
Results 1 to 3 of 3