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
Зареєструйся Зараз
або Підпишись на майбутні тести