A
A
ak40u2011-07-19 20:40:10
OOP
ak40u, 2011-07-19 20:40:10

Why is the main method executed without creating a class object in OOP languages?

public class test {
  public static void main(String[] args) {
  System.out.println("привет");
  }
}


1. What is the name of the test class in which the main method is the start one?
2. Why is the main method executed without creating an object (class instance) of the start class? Indeed, in all other cases, if you want to execute a method, you must create an object and then call the method.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew1000000, 2011-07-19
@Andrew1000000

This method is static.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question