Answered step by step
Verified Expert Solution
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
Q2. Write a java program for the UML diagram given 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!");}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started