Discussion Board
There are no previous messagesGo to the following message
Current Forum: Homework 4 General Forum
Date: Thu Oct 11 2001 6:55 am
Author: Chen, Richard <richardc@andrew.cmu.edu>
Subject: casting

what I have:
String token;

what I want to do:
//assuming HuffmanCharFreq is as it came originally
//assuming some loop here gives a value for int i
HuffmanCharFreq hcf=new HuffmanCharFreq(1,(Character)token.charAt(i));

which doesn't work.

1. why not?
2. how do I cast from the single char I read to the Character needed for the HuffmanCharFreq constructor?
Post response

There are no previous messagesGo to the following message
Current Thread Detail:
casting      Chen, Richard      Thu Oct 11 2001 6:55 am       
Re: casting      Lee, Peter      Thu Oct 11 2001 9:09 am       
Re: casting      Detwiler, Jay T.      Thu Oct 11 2001 5:40 pm       

Back to previous screen