Is the C# “explicit implementation” of the interface present in Java?

No, there's nothing like C#'s explicit interface implementation in Java.

No, there's nothing like C#'s explicit interface implementation in Java. On the plus side, Java has covariant return types, so if you want to provide a more strongly typed implementation than the interface specifies, that's okay. For instance, this is fine: interface Foo { Object getBar(); } public class Test implements Foo { @Override public String getBar() { return "hi"; } } C# wouldn't allow that - and one of the ways around it is typically to implement the interface explicitly and then have a more specific public method (usually called by the interface implementation).

Second 'C#' should be 'Java' in opening sentence. – eljenso Feb 21 '09 at 20:04.

You can only do this if the methods are overloaded. If you have two method which are expected to do different things, they should have different names IMHO.

No and it should never be present in Java. It's just another bone to throw at people who can't be bothered with good design. Explicit implementation of an interface should never be needed or used.

There are better ways to solver the problem that this tries to solve.

That's another useful OOP capability missing from Java. – Ben Voigt May 21 '10 at 4:41 It will never be in Java for the same reason that delegates will never be in Java.. google it. There is a good article about why delegates where never done in Java and this is similar.

It's bad because of what it allows you to do not the good stuff you can do with it. Something Microsoft and it's ecosystem don't get. – eaglestorm May 24 '10 at 0:20 1 @ealgestorm, you do realize that even Swing "abuses" objects to make them behave like delegates, right?

Also, I do find it a bit amusing that almost all of your questions are related to .NET. – Nullable Jul 12 at 17:04 @DontCare4Free lol you should read up on why java was designed that way, I think delegates are one of the things that are a bad design choice in . NET - it leads to bad design because of what you can do with them.

– eaglestorm Jul 13 at 0:08 1 Eaglestorm, care to eat your words? Openjdk.java.Net/jeps/126 – Aaron Friel Nov 9 at 17:00.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions