Define a class named “A” manages a document id (integer)and a document title (string).This class will throw the InvalidItemException whenever a A  is created with a negative ID or an empty or blank title with proper error code.The class must at least provide the following methods: isDuplicatemethodthat compares with another A or its derived class object. It returns true if both have the same ID and title and false otherwise. isAlphabeticallyBeforemethod that compares with another A derived class object. It returns true if its title is alphabetically before the otherA’s title and false otherwise

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter12: Exception Handling
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Define a class named “A” manages a document id (integer)and a document title (string).This class will throw the InvalidItemException whenever a A  is created with a negative ID or an empty or blank title with proper error code.The class must at least provide the following methods:

isDuplicatemethodthat compares with another A or its derived class object. It returns true if both have the same ID and title and false otherwise.

isAlphabeticallyBeforemethod that compares with another A derived class object. It returns true if its title is alphabetically before the otherA’s title and false otherwise

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Software Development
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