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? |
|