Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying default constructors #21

Open
cathylee12 opened this issue May 11, 2023 · 4 comments
Open

Displaying default constructors #21

cathylee12 opened this issue May 11, 2023 · 4 comments

Comments

@cathylee12
Copy link
Contributor

cathylee12 commented May 11, 2023

I would like to display the default constructors in the diagram, as well, for the consistency. If you agree, I can try to add the feature.

@shuzijun
Copy link
Owner

Is there an example to illustrate this function? Currently, constructors are supported.

@cathylee12
Copy link
Contributor Author

cathylee12 commented May 11, 2023

Yes, so for example, in ExampleConstructor class, if I don't explicitly declare public ExampleConstructor(), <<Create>> ExampleConstructor() does not show up in the diagram.

@cathylee12
Copy link
Contributor Author

I compared with two different source code, one with the declaration of the constructor and one without it.

package example;

public class ExampleClass {

}
package example;

public class ExampleClassWithConstructor {

  public ExampleClassWithConstructor() {
  }

}

The diagram output is like this.

@startuml
class example.ExampleClass {
}
class example.ExampleClassWithConstructor {
+ <<Create>> ExampleClassWithConstructor()
}
@enduml

Here is the link describing a default constructor.
https://www.scaler.com/topics/default-constructor-in-java/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants