Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

When trying to call an inner-class, I am getting 'cannot find symbol - constructor Node()'.

Below is my code:

public class Compress {
     ...

public void compress(InputStream in, OutputStream out) {
        ...

        Node n = new Node();
        n.makeHuffmanTree(in);
    }

    class Node implements Comparable<Node> {
        Node left;
        Node right;
        Node parent;
        String chara;
        int frequency;
        HashMap<Character,Integer> map;
        HashMap<Character,String> treeMap;
        int position;

              ...

        public void makeHuffmanTree(InputStream in) {


           findFreq(in);

           String[] charStr = new String[map.size()];
           String[] freqStr = new String[map.size()];
           Set entries = map.entrySet();
           Iterator entriesIterator = entries.iterator();

           String chara[];
            ...
        }
    }
}

Not quite sure what is happening here? Any ideas?

share|improve this question
I'm confused: You state your problem is with a super class calling a sub-class, but there is no sub-class super-class relationship here. Also, why the inner class? Also, does your Node class have a constructor that you're not showing us? Is it public? – Hovercraft Full Of Eels 27 mins ago
My mistake, edited question. There is no constructor, I have tried public but that doesn't work. – ron8 25 mins ago
2  
1) show your actual error message. 2) show the real code that you're using. I have a feeling that you're not showing us correct and relevant code. – Hovercraft Full Of Eels 24 mins ago
The actual error is: 'cannot find symbol - constructor Node()' when trying to compile. – ron8 19 mins ago
Your code still does not show the reason for the error. This question cannot be answered as shown. – Hovercraft Full Of Eels 18 mins ago
show 2 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.