I understand that in the fields of a class, you can make the field type the name of another class and then in the constructor initialise that field by calling a new class of that type, i.e.
public class Auction {
private Bid bid;
}
public Auction {
bid = new Bid();
}
The main reason for doing this is, as I understand it, to access the methods of that class.
My question is I've noticed in some methods that there are local variables created that have a type of a different class with a variable name. What is the purpose of assigning a local variable name with a type of another class? Is this another way of just accessing those methods directly, even if it hasn't been done in the fields or constructor?