196,139 views
5 votes
5 votes
The clone() method expects no arguments when called, and returns an exact copy of the type of bag on which it is called.

User Mkalkov
by
2.8k points

1 Answer

16 votes
16 votes

Answer:

true

Step-by-step explanation:

This statement is true. This is a method found in the Java programming language and is basically used to create an exact copy of the object that it is being called on. For example, in the code provided below the first line is creating a new object from the Cars class and naming it car1. The second line is creating an exact copy of car1 and saving it as a new object called car2. Notice how the clone() method is being called on the object that we want to copy which in this case is car1.

Cars car1 = new Cars();

Cars car2 = (Cars) car1.clone();

User JoGoFo
by
2.8k points