How constructor called?

1 answer

Answer

1003641

2026-07-22 12:50

+ Follow

You cannot invoke a constructor explicitly. It will get invoked implicitly when you call the new keyWord on the class to create an object of the class.

Ex:

private ClassExample obj = new ClassExample();

here this new keyWord usage on the ClassExample class will invoke the constructor of this class and create an object of that class.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.