Welcome! Log In Create A New Profile

Advanced

Assignment 3 Q2

Posted by GerritB 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 3 Q2
May 27, 2009 01:38PM
When creating the interface methods, how do you specify the fact that they should handle any type? i.e. enqueue should be able to enqueue strings, or ints, or doubles(though obviously not in the same queue)...
I know in c++ you'd use templates, but I'm a bit murky on what they want here, is it even necessary to create one like that, or can you just stick to one type?

(Sorry if I sound a bit muddled, I'm writing philosophy on tuesday, and it's melting my braineye popping smiley)
Re: Assignment 3 Q2
May 28, 2009 02:52PM
As far as I know, you'll use the Object type. I think everything basically extends Object, therefore it should cater for anything in the queue
Re: Assignment 3 Q2
May 29, 2009 03:48PM
Yep, it's Object. In your implementation you'd then cast said object.
Sorry, only registered users may post in this forum.

Click here to login