studentRecord.getName() returns an object of type string. and getStudentName() then returns the string object that was returned by studentRecord.getName(); only with primitives (int, char, boolean, double, float, etc...) do you pass or return a value instead of an address to an object.
remember you pass the address of objects and the values of primitives. The compiler checks the types to make sure you pass and object of the correct type. Thus with public String getName() your return has to have an object of type String or a subclass of String or it will throw an error. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
