Which of the following signatures may be used to declare a method main() that will be the entry point when the application starts? (Select all valid options)

   1. public static void main()
   2. public static void main(String arg[])
   3. public void main(String [] arg)
   4. public static void main(String[] args)
   5. public static int main(String [] arg)
Explanation
The correct main definition is public static void and must accept array as a parameter. Both 2 and 4 are correct array of strings parameter definitions.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты