Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java two constructors

public class Book
{
    private final String title;

    public Book(String title)
    {
      this.title = title;
    }

    public Book()
    {
      this("Default Title");
    }

    ...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #constructors
ADD COMMENT
Topic
Name
8+2 =