The Article class has a default constructor with no parameters. Define a public overloaded constructor that takes two string parameters and initializes the article's title and author with the strings. Ex: If the input is Airport Hall, then the output is: Article: Unspecified, Undefined Article: Airport, Hall Article.java   public class Article { privateStringtitle; privateStringauthor;   publicArticle() { // Default constructor title="Unspecified"; author="Undefined"; }   /* Your code goes here */   publicvoidprint() { System.out.println("Article: "+title+", "+author); } } Archive.java

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

The Article class has a default constructor with no parameters. Define a public overloaded constructor that takes two string parameters and initializes the article's title and author with the strings.

Ex: If the input is Airport Hall, then the output is:

Article: Unspecified, Undefined Article: Airport, Hall

Article.java
 
public class Article {
privateStringtitle;
privateStringauthor;
 
publicArticle() { // Default constructor
title="Unspecified";
author="Undefined";
}
 
/* Your code goes here */
 
publicvoidprint() {
System.out.println("Article: "+title+", "+author);
}
}
Archive.java
 
 
 
 
 
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,