wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes EchoTestDrive failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "EchoTestDrive failure" Watch "EchoTestDrive failure" New topic
Author

EchoTestDrive failure

Rogers Dean
Greenhorn

Joined: May 11, 2014
Posts: 1
Pretty much brand new to programming (some SQL...). Just fixed EchoTestDrive cannot compile issue I was about to post on, now have some other issue.

Here is the code for EchoTestDrive.java:



/**

Here is the code for Echo.java, which compiles:



/**

I have complied both successfully and have run: java EchoTestDrive, and the result is a continuous result of this:

"at Echo.<init>(Echo.java:5)"

Any ideas?

Thanks!


Kondwani Chipeta
Greenhorn

Joined: Aug 17, 2011
Posts: 25
Hello Rogers,

And welcome to the Ranch.

Could you read this page on how to post code on the forum.
It makes it easier for others to read your code.

As for your error, I compiled and ran the code and got the following output:

helloooo...
helloooo...
helloooo...
helloooo...
4



The error message you are getting seems to show there is a problem on line 5 of the Echo class.
Could you repost the code using the code tags.

Kondwani.


OCPJP 1.6
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37990
    
  22
Welcome again. I have sorted out the code tag problem, but again could not reproduce your error. I also got rid of some of the excess blank lines, which do not add to legibility, but I do not think I have altered the code materially.
The only way I think you can get such an error is by recursively calling the constructor in the same class, like Foo here:-You are creating so many objects that you are running out of space for all the constructor calls. I cannot see any code which would produce that error with what you posted. Please check.
Don't use HTML br tags in your posted code; only use spaces for formatting.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EchoTestDrive failure
 
Similar Threads
Classes and Projects Chapter 2 of Head start JAVA pool puzzle
Head First Public Class Question
Can some one explain this to me. It Display Hello 4x and output is 24
Can someone explain how this code works?
Would like help about this excercise in HFJ