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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Andrina writes letters that are regularly sent to hundreds of her company’s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
The forerunner to cell phones, pdas, and smartphones was
Answers: 1
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
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
question
Mathematics, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
question
Biology, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
Questions on the website: 13722367