Skip to main content
0 votes
2 answers
109 views

@FunctionalInterface interface StringConsumer extends Consumer<String> { @Override public default void accept(String s) { System.out.println(s.toUpperCase()); } void ...
Alper ARSLAN's user avatar
0 votes
1 answer
39 views

When calling findBySubstring() from ArticleAutocompleteServiceImpl - default method of interface is executed instead of implementation. Is it because of generics? What did I do wrong? How to keep this ...
user avatar
1 vote
1 answer
273 views

I'm getting the following error while implementing the java.util.Iterator interface in my class: java: MenuIterator is not abstract and does not override abstract method remove() in java.util.Iterator....
Aleksandar Zizovic's user avatar
1 vote
1 answer
152 views

Question: Need to understand why in case of Program 1 getting this misleading error, but in Program 2 it gives correct error? Also why unlike toString(), equals(Object), and hashCode(), overriding ...
PANKAJ DUBEY's user avatar
2 votes
0 answers
60 views

When instantiating a class that has code to explicitly call a default method for an interface that it implements, a java.lang.VerifyError is thrown. This happens on Kitkat (API 19), but Lollipop and ...
ewittman's user avatar
0 votes
2 answers
1k views

How can I write a junit test case for default methods of interface with zero lines of code as mentioned below : public interface A{ default void method1(){ } }
Theodore's user avatar
0 votes
1 answer
356 views

I am a beginner in Java. I have a question about the abstract method in Interface. Is the following sampleMethod() an abstract method? My understanding is that it is not an abstract method due to ...
Lei's user avatar
  • 11
0 votes
1 answer
68 views

I have 4 Classes that look like this: public interface Foo<T> { ... default boolean isEmpty() { return false; //dummy value real implementation is not relevant for the problem } } public ...
RedCrafter LP's user avatar
5 votes
0 answers
46 views

I don't understand why an IllegalAccessError exception is thrown from the example below. The method foo() in Parent cannot be inherited by Child, because it is private. But trying to call the default ...
Andrey's user avatar
  • 59
1 vote
1 answer
163 views

I have stumbled upon a strange issue working with default methods. Consider this situation: interface A { int method(); } interface B { default int method() { return 1; } } class ...
gscaparrotti's user avatar
5 votes
2 answers
309 views

What is the point of making Functor a super class of Applicative and Monad. Both Applicative and Monad immediately imply the only implementation of Functor that abides by the laws as far as I can tell....
HashBr0wn 's user avatar
2 votes
1 answer
3k views

I've generated rest api with openAPI generator maven plugin and I've overridden the default method from MyApiDelegate interface, but POST request on /endpoint provides 501 NOT IMPLEMENTED as if I hadn'...
obolen_an's user avatar
0 votes
1 answer
396 views

You often hear that methods in an interface have no implementation. However, in Java 8 it became possible to implement the default methods. But I'm interested. Was and is it possible to implement ...
stfxc's user avatar
  • 174
1 vote
1 answer
272 views

Is there a way to easily override toSet(Collection<T> self) method from DefaultGroovyMethods? Its implementation uses HashMap public static <T> Set<T> toSet(Collection<T> self) ...
ilPittiz's user avatar
  • 812
0 votes
0 answers
94 views

interface WithDefinitionsInter { default void definedMeth() { System.out.println("inside interface"); } } class WithDefinitionsImpl implements WithDefinitionsInter { ...
Manish Bansal's user avatar

15 30 50 per page
1
2 3 4 5
12