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.
About Question com.enthuware.ets.scjp.v6.2.473 :
Moderator: admin
-
- Posts: 50
- Joined: Sun Nov 10, 2013 4:39 am
- Contact:
-
- Site Admin
- Posts: 10062
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.473 :
You can't.
If you like our products and services, please help us by posting your review here.
-
- Posts: 3
- Joined: Sun Feb 07, 2021 2:58 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.473 :
Code: Select all
//Filename: TestClass.java
class TestClass implements T1, T2{
Code: Select all
//Filename: TestClass.java
public class TestClass implements T1, T2{
-
- Site Admin
- Posts: 10062
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.473 :
>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.
Where did you read that?
The rule is, a public class must be in a file by the same name.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 115 guests