What will be printed out as a result of the following code compilation and execution?

public class Quest {
    public static void main() {
        System.out.print("A");
   }
    public static void main(String args) {
        System.out.print("B");
    }
    public static void main(String[] args) {
        System.out.print("C");
    }
}
Explanation
The correct syntax for method main() is in the one that prints "C". Only this method will be run when application starts. Other methods are correctly defined, they have same name, this is called overload so no errors will occur.

DUDE

2023 Feb 6, 11:40:00 AM

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести