Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.473 :

Posted: Sun Feb 09, 2014 5:33 am
by devlam
The only problem is that you can't implement different implementations m1, 1 for T1 and 1 for T2.
How do you solve that problem if your class must implement two interfaces which have the same method and you want a different implementation for each.

Re: About Question com.enthuware.ets.scjp.v6.2.473 :

Posted: Sun Feb 09, 2014 6:18 am
by admin
You can't.

Re: About Question com.enthuware.ets.scjp.v6.2.473 :

Posted: Wed Apr 14, 2021 5:55 pm
by barrantesgerman

Code: Select all

//Filename: TestClass.java
class TestClass implements T1, T2{
The class must be public, because the file name is the same as the class.

Code: Select all

//Filename: TestClass.java
public class TestClass implements T1, T2{
Correct answer: None of the above.

Re: About Question com.enthuware.ets.scjp.v6.2.473 :

Posted: Wed Apr 14, 2021 8:04 pm
by admin
>The class must be public, because the file name is the same as the class.

Where did you read that?

The rule is, a public class must be in a file by the same name.