Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

is my answer correct??? fix the code and provide the run screen import java.util.Date; public class Document { private String[] authors; private Data date; int

is my answer correct??? fix the code and provide the run screen
import java.util.Date;
public class Document {
private String[] authors;
private Data date;
int index;
public Document(){
authors =new String[50];
index=0;
}
public String[] getAuthors() {
return authors;
}
public void addAuther(String name);
{
authors[index]=name;
index++;
}
public Date getDate(){
return date;
}
public class Book extends Document{
private String title;
public String getTitle(){
return title;
}
public class Email extends Document{
private string subject;
private String []to;
public String[] getSubject() {
return subject;
}
public String[]getTo()
{return to;
}
}
public static void main (String[]args)
{
Book book=new Book();
book.setTitle("the");
book.setAuther("ghaida");
Email email=new Email();
email.setAuthor("gh");
email.setSubject("order");
email.setTo("Jeeee");
System.out.println("Subject:"+email.getSubject());
System.out.println("Dear"+email.to+","+"Thank you for your purchase on the book"+book.getTitle()+"by"+book.getAuthor()+". we are from" +email.getAuthor()+" Happy raeding!");}
image text in transcribed
Q2. Write a java program for the UML diagram given

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions