How do you get a default constructor?

1 answer

Answer

1058949

2026-04-30 22:10

+ Follow

Java
Java

The default constructor is an empty (only call the super constructor) with no parameters constructor inserted by the Java compiler when you don't define a constructor in your class. If you write something like this:

public class NoConstructorClass{

//no constructor goes here

}

Then you get something like this:

public class NoConstructorClass{

public NoConstructorClass(){ // Default constructor that you didn't write

super();

}

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.