Discussion Board
There are no previous messagesGo to the following message
Current Forum: Homework 3 Forum
Date: Sun Sep 30 2001 1:42 pm
Author: Han, Shanshan <shanshan@andrew.cmu.edu>
Subject: Compilation Error: static to nonstatic?

TrieNode tn;
tn = root;
^
Error message:
Can't make static reference to a nonstatic variable root...

//root is constructed as:
//TrieNode root = new TrieNode();
//which construct a TrieNode with an array of size 256, and nothing else

1. How should i fix this problem?
2. if i construct the root the way describe above, would my root == null?

thanx,
Helen



Post response

There are no previous messagesGo to the following message
Current Thread Detail:
Compilation Error: static to nonstatic?      Han, Shanshan      Sun Sep 30 2001 1:42 pm       
Re: Compilation Error: static to no...      Lao, William      Sun Sep 30 2001 2:36 pm       

Back to previous screen