|
Advertisement
|
Forum posts by Chad Daniels:1 page [ 1 ]
Posted in Java Answers Forum, Mar 8, 2002, 1:28 AM
I need to know how to pass the type of an object into a method and then use the passed type to cast a generic Object so that I can use specific methods.For example, lets say I'm creating a program for the local dog pound: I have an ArrayList with Dog objects. I loop through the ArrayList and retrieve one Dog at a time (retrieved as type Object...
Posted in Java Answers Forum, Mar 8, 2002, 1:09 AM
It is legal to declare two variables with the same name if they are in two different methods. Each one occupies its own spot in memory and is directly associated with the method in which it was created. Remember that that a variable lives and dies within the curly braces of its parent method. Changing the value of one does not affect the value...
1 page [ 1 ]
|