5 years ago in Java Strings

What will happen if you try to compile and run the following code ?
public class MyClass {

public static void main(String arguments[]) {

}

public void amethod(String[] arguments) {

}

}

[A] error Can't make static reference to void method.
[B] error method main not correct
[C] error array must include parameter
[D] amethod must be declared with String
Loading...
Next Question

Overall Stats

Attempted 324
Correct 60
Incorrect 117
Viewed 147

Answers

Guest
Guest
Cristian Budaianu - 2 years ago

code will compile and run without any warning and errors.

Dipesh Rane - 3 years ago

All options are in correct, above code will compile and run without any warning and errors.

bruh
bruh - 4 weeks ago

bruh from Guwahati, India is saying error method main not correct is correct answer

Zo Go
Zo Go - 4 weeks ago

Zo Go from Casablanca, Morocco is saying error method main not correct is correct answer

Vaibhav Bisht
Vaibhav Bisht - 4 weeks ago

Vaibhav Bisht from Dehradun, India is saying error method main not correct is correct answer

Related Questions

What is the output of the code ?
public class AQuestion{

      private int i = j;

      private int j = 10;

      public static void main(String args[]){

            System.out.println((new AQuestion()).i);

      }

}

  • [A] Compiler error complaining about access restriction of private variables of AQuestion.
  • [B] Compiler error complaining about forward referencing.
  • [C] No error - The output is 0;
  • [D] No error - The output is 10;