Русский
Открыть в Telegram

Ветка Сообщение #243

3 сообщения · –
  1. K
    There is no overloading of main function. After javac Test.java Three class files are created Test.class Test1.class A1.class Each of the classes has a main method java Test1 runs the main method in Test1 class So, in line 13 "This is test 1 class" is printed. Then Test.main(new String[4]) is called Means the main function of the Test class is called from the main function of Test1 class. As main has a parameter String[] so a String array {null, null, null, null} is passed. "Hello World" is printed Then Test.main() is again called with args. Here args is the args of Test1.main() which is null. So Test.main() with argument null is called. "Hello World" is printed
    1. K
      main() function is not anything different from other functions. While running the program the JVM calls the main() function with the cmd-args as String[] (if any). You can also call main function inside main function.
CCore Java | Java for BeginnersCore Java | Java for Beginners@codeitupjava · группа · Технологии
1 312участников62пишущих за 30 дней
Лента площадки Открыть в Telegram

Открытая публичная лента из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Границы индекса · Убрать страницу из выдачи · Каталог · Поиск · Как мы считаем