I have one small doubt. I have confuse in sending the object as method's argument. Is possible to give one simple example coding for this.
In the method's argument what are all the things we can pass?
for example: If we are sending the object of class 'A' as the method's argument, we can say that we are sending all the variables and methods in that class 'A'. I think I am missing something or mess up something.
Please provide one example coding on how we can pass the class' object as the argument. And also if possible what are the things happening inside the coding will be very helpful.
you actually pass reference variable of an object not the object itself. Example, if you have an ArrayList of Pets it contains object references of Animals. You can fill up your Arraylist through a method that takes in Object References as an argument.