-4

When trying to compile program demonstrating the use of Binary Search Tree inside terminal, javac throws error on some line in my code.

enter image description here

Although when compiling exactly the same code within (https://www.jdoodle.com/online-java-compiler) no error encountered and works just fine.

Here's the actual code that i have to deal with. https://codeshare.io/5Z03ve

Expected Output is:

Node with the key 75

Sales Manager has the key 75

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Ian Kuzin
  • 37
  • 1
  • 6
  • If I cut your code from https://codeshare.io/5Z03ve and I run it on https://www.jdoodle.com/online-java-compiler I get the same error – luca.vercelli Apr 17 '19 at 12:42
  • Please read "How to create a [mcve]". Then use the [edit] link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you. – GhostCat Apr 17 '19 at 12:45
  • 2
    Please read [no pictures of exceptions](http://idownvotedbecau.se/imageofanexception/) / [no pictures of code](http://idownvotedbecau.se/imageofcode). Then use the [edit] link to replace screen shots of text with nicely formatted/indented text within your quesiton. – GhostCat Apr 17 '19 at 12:46
  • 1
    Please don't vandalize your question. It has already been marked as a duplicate of another question, no need to replace your question text with another link. – ChrisGPT was on strike Dec 06 '22 at 19:26

1 Answers1

0

Pay attention while copying code, you've changed class name so Java didn't know what BinaryTree is.

Replace

public static void main(String[] args) {
BinaryTree theTree = new BinaryTree();

By this

public static void main(String[] args) {
JavaExercises theTree = new JavaExercises();
megatunger
  • 72
  • 1
  • 4