subject
Computers and Technology, 28.11.2019 07:31 amoauya

Define a class named document that contains an instance variable of type string named text that stores any textual content for the document. create a method named tostring that returns the text field, and also include methods gettext and settext to get and set this value, respectively. include the constructor that set all of the instance variables. redefine equals method to test whether two documents are equal.

next, define a class for email that is derived from document and includes instance variables for the sender, recipient, hasattachement and subject of an email message. implement appropriate accessor and mutator methods. the body of the email message should be stored in the inherited variable text. redefine the tostring method to concatenate all text fields. include the constructor that set all of the instance variables. redefine equals method to test whether two emails are equal.

similarly, define a class for file that is derived from document and includes an instance variable for the pathname, size (e. g., 10kb, 100kb, etc) and filetype (e. g., pdf, doc, … the textual contents of the file should be stored in the inherited variable text. redefine the tostring method to concatenate all the text fields. include the constructor that set all of the instance variables. redefine equals method to test whether two files are equal.

finally, make the email and the file classes implement the comparable interface. define the compareto method to order email objects based on the sender name. also, define compareto method to order file objects based on the file size.

note: hasattachment is a boolean variable. true when an email has an attachment, otherwise false.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, mikey3882
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, ladawnrowles005
The option enables you to modify a slide element in most presentation applications.
Answers: 2
image
Computers and Technology, 23.06.2019 21:20, nathanfletcher
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
image
Computers and Technology, 24.06.2019 00:20, talyku843
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
You know the right answer?
Define a class named document that contains an instance variable of type string named text that stor...

Questions in other subjects:

Konu
Mathematics, 01.07.2019 18:10
Konu
Mathematics, 01.07.2019 18:10