Win a copy of Spring in Action (5th edition) this week in the Spring forum!

Latif Ben

Greenhorn
+ Follow
since Jun 23, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Latif Ben

6 years ago

fred rosenberger wrote:it's hard to say, since you didn't tell us what class you are running. All three you provide have a main, so any could be what you run. it looks like you may actually be running all three, one at a time, but simply lumped your results into out output. So really, i'm just guessing here.

in First, you create a Second object. When you make that, you have to create a First object. When you make that, you have to make a Second object. When you make that, you have to make a First object...

In One, you make a Two object. To make that, you need to make a Two object. To make that, you have to make a Two object. To make that...

In Cls, you call the met() method. That method calls the met() method. That method calls the met() method. That method...

in each case, it appears you have infinite recursion.



Thanks for your answer
actually im running every program separately, not one at a time
7 years ago
Hi,

Why this happens when I try to run these codes:







I got something like this :


at First.<init>(First.java:4)
at Second.<init>(First.java:18)
at First.<init>(First.java:4)
at Second.<init>(First.java:18)
at First.<init>(First.java:4)

at Two.<init>(One.java:16)
at Two.<init>(One.java:16)
at Two.<init>(One.java:16)
at Two.<init>(One.java:16)
at Two.<init>(One.java:16)

at Cls.met(Cls.java:7)
at Cls.met(Cls.java:7)
at Cls.met(Cls.java:7)
at Cls.met(Cls.java:7)
at Cls.met(Cls.java:7)

7 years ago
Hi,

when I try to define an abstract method within an enum I get the following error :
enumtest is not abstract and does not override abstract method AbstractMetEnum() in enumtest
how to fix it ?

7 years ago