If a class has more than one constructor which of them gets called?

1 answer

Answer

1068909

2026-04-13 19:35

+ Follow

In a class with multiple constructors, the specific constructor that gets called is determined by the arguments passed during object instantiation. The compiler selects the constructor that matches the number and types of arguments provided. If no matching constructor is found, a compile-time error occurs. This process is known as constructor overloading.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.