Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

adding a method to a class or project?

$
0
0
hi all, so i was given 3 classes premade - "name" groups fields for a name , "Address" groups fields for address and then a "person" groups fields for a person. i then have a test class with a main in order to test these 3 classes....

my program modification excerse is to add a 'compareto' method to the "name" class which will compare two last , first names and return -1 0 1 depending on the result...

i know how to make this i am not quite sure if i add this method to the actual "name" class i wont be able to do this correctly would i? should it be made as a method within the testclass?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>