Results 1 to 3 of 3
Thread: Type Casting Help
- 02-06-2008, 11:23 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 12
- Rep Power
- 0
Type Casting Help
I believe this is a problem with Type casting but I am not sure. I have a LinkedList class that I have created which stores nodes of type Object. I am building a print queue that uses the list and stores an Object of type printdata in the nodes. This line of code here gives me the following error message:
Type mismatch: cannot convert from Object to PriorityQ.printdata
printdata temp = L1.getNode(0);
I assume that I need to type cast but I don't know how.
- 02-07-2008, 12:52 AM #2
stores an Object of type printdata
Try declaring/adding this "printdata" as the type instead of Object.
Java Code:LinkedList<printdata> list = ...
- 02-07-2008, 12:06 PM #3
Similar Threads
-
Casting an int value into a char
By kurtulas in forum New To JavaReplies: 2Last Post: 02-16-2008, 08:03 PM -
'Casting' couch !!!!
By ajaygargnsit in forum Advanced JavaReplies: 4Last Post: 01-04-2008, 04:54 PM -
'Casting' couch !!
By ajaygargnsit in forum New To JavaReplies: 1Last Post: 12-22-2007, 01:05 PM -
Casting
By leebee in forum New To JavaReplies: 5Last Post: 08-10-2007, 12:24 PM -
The return type
By Marcus in forum New To JavaReplies: 1Last Post: 07-05-2007, 06:28 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks