I am taking a Java class and my instructor wants us to fill in this method:
public LL( LL other )
{
}
He gave us no indication as to what it does. Is this a copy constructor like in C++?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it’s probably a copy constructor. You’ll know only when the instructor gives you the javadoc of the constructor, which defines its contract.
But in all likelyhood, this constructor should create a new linked list containing the same elements as the linked list passed as argument.
Side note:
LLis a terrible name for a class. Why not useLinkedListinstead?