Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the Name.java and Student.java files, expand both classes to include the following methods: A copy constructor, A clone method, A finalize method, A dispose

Using the Name.java and Student.java files, expand both classes to include the following methods: A copy constructor, A clone method, A finalize method, A dispose method, and A hashCode method. A compareTo method

Test the upgraded classes using the application TestStudentName.java Be sure to include output messages in both the finalize method and the dispose method.

I have uploaded the following code files to start:

Name.java

image text in transcribed

Student.java

image text in transcribed

TestStudentName.java

image text in transcribed

image text in transcribed

public class Name private String first //first name private String last // last name public Name) this (, "" ); public Name String firstName, String lastName) 12 3 fi rst fi rst Name ; last = lastName ; public void setName(String firstName, String lastName) fi rst fi rst Name ; last = lastName ; public Name (Name obj) throws Nul I PointerException t/ Copy Constructor public void setFirst ( String firstName) { first = firstName public void setLast (String last Name ) { last = last Name: public String getFirst) public String getLast () publ ic String getName () public void giveLast NameTo Name aName) return first return last return toSt r ing) 30 aName.setLast ast; publ ic String toStr ing) return first ast public void finalize ) public void dispose // finalize method //dispose method [ 15/ end Name

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

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

What is topology? Explain with examples

Answered: 1 week ago

Question

=+How should it be delivered?

Answered: 1 week ago

Question

=+4 How does one acquire a global mindset?

Answered: 1 week ago