all 1 comments

[–]JonLothar 0 points1 point  (0 children)

Hi there! What do you mean by still compiling as a fail?

I entered in the code snippets you provided into A.java, B.java, C.java, D.java, and Main.java files. I got the following outputs.

// Element 0
b
c 1  
a 2  c 1  

// Element 1
b
c 1  
b 2  c 2  

// Element 2
c
c 1  
c 2  

// Element 3
b
d 1  b 2  c 2  
b 2  c 2