Results 1 to 2 of 2
  1. #1
    vtecjerry is offline Member
    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Default Program will not compile?

    public class TestBinaryTree {


    public static void main(String[] args) {
    BinaryTree<String> tree = new BinaryTree<String>();
    tree.insert("George");
    tree.insert("Michael");
    tree.insert("Tom");
    tree.insert("Adam");
    tree.insert("Jones");
    tree.insert("Peter");
    tree.insert("Daniel");
    printTree(tree);

    System.out.println("\nAfter delete George: ");
    tree.delete("George");
    printTree(tree);

    System.out.println("\nAfter delete Adam: ");
    tree.delete("Adam");
    printTree(tree);

    System.out.println("\nAfter delete Michael: ");
    tree.delete("Michael");
    printTree(tree);

    }

    public static void printTree(BinaryTree tree){
    // Traverse
    System.out.print("Inorder (sorted): ");
    tree.inorder();
    System.out.print("\nPostorder: ");
    tree.postorder();
    System.out.print("\nPreorder: ");
    tree.preorder();
    System.out.print("\nThe number of nodes is " + tree.getSize());
    System.out.println();
    }
    }


    Gives me this:
    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
    symbol: class BinaryTree
    location: class TestBinaryTree

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    Where is the definition for the class: BinaryTree? The compiler can not find it?

Similar Threads

  1. my program cannot be compile
    By justlynn in forum NetBeans
    Replies: 8
    Last Post: 08-17-2010, 10:11 AM
  2. Compile and run a java program through another one
    By z.zojaji in forum Advanced Java
    Replies: 9
    Last Post: 07-15-2010, 07:06 AM
  3. My Java program will not compile and run?
    By sabrown311313 in forum Java Applets
    Replies: 1
    Last Post: 09-23-2008, 09:38 AM
  4. Program Won't Compile
    By JavaLovenJoe in forum New To Java
    Replies: 2
    Last Post: 04-22-2008, 01:31 PM
  5. Compile a program
    By toby in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •