F
F
Fedor unknown2020-04-14 16:03:04
Java
Fedor unknown, 2020-04-14 16:03:04

Why can't I pass two arguments to a method?

Why can't I pass two arguments to a method?

public class FirstClass {
    public static int main(String[] args) {

         static int foo(int b, int a){
            int c;
            c = a + b;
            return c;
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-04-14
@turdubekov

And the method in the method is legal from the point of view. Javas?
Move foo out of main, this is most likely the reason.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question