ok!!
public static void main(
String [] args)
{
Mineral [] ma = {new Mineral(), new Gem()};
for(Object o : ma)
getWeight((Mineral)o);
}
here Mineral is the Base class,ma is the reference to the class Mineral
you will notice at right side new Mineral,new Gem......now here it is instantiated by writing "new" ...."so ma becomes the object".
Later enhanced for loop is used,where Object o is assigned object ma(actualy value),than getweight method is called.
i hope it helps you to atleast some extent.
