Questions tagged as 'interface'

1
answer

Using the Consumer Interface

What is the advantage of using the Consummer interface of java in this way? Example: UsuarioConsummer have a class that implements the interface%% Consummer and calls their method acept % following example: public class UsuarioCo...
asked by 27.03.2016 / 04:13
1
answer

Call graphical interface in java

My doubt is simple, I think. I need to call this interface CadastroGUI d = new CadastroGUI() ; which I already have ready, but I want the fields already appear filled, after all, it is a query command by CPF where I want to return the clie...
asked by 01.12.2015 / 02:00
3
answers

Is an interface a variable?

I have some doubts about interfaces in relation to the way they are used. I thought the interface was not used as a variable that represents and stores some kind of data, see MinhaInterface mInterface; instead of having the sole purpos...
asked by 01.07.2016 / 20:35
2
answers

What is the purpose of the default when used in the signature of a method?

Within the List<E> interface of Java there is the replaceAll() method whose purpose is to replace all occurrences of a specified value in a list. However, in your signature it uses the command default , this has conf...
asked by 08.03.2016 / 22:04
1
answer

How to make an interface in C ++?

Java, C #, and other languages have the interface concept, which is very useful in some circumstances. How to make an interface or the closest to it in C ++?     
asked by 07.05.2016 / 01:15
1
answer

GenericDAO - Is that correct?

I'm implementing a simple GenericDAO as below, but I feel like I'm doing something wrong, it works but I feel like there's something wrong anyway, could you help me? I created an interface like this: public interface GenericDAO<T,...
asked by 05.01.2015 / 15:57
1
answer

Inheritance with interface [closed]

How can I solve the following problem. Scenario: I have a class B that inherits from class A and implements interface I. Problem: The interface I forces the implementation of method X which in turn is implemented in class A, not in B....
asked by 12.06.2014 / 15:51
3
answers

IFs and Object Orientation - C #

I have a question about how to replace IF with polymorphism. I'll give you the following example: Let's say I have the ExecucaoIndividual and ExecucaoGeral classes. For this I created an interface to use the strategy pat...
asked by 26.06.2015 / 17:28
2
answers

Interface and inheritance for the java connection class

Considering object orientation, would the use of inheritance and interface in this way be correct? But in this way, any request to connect to the database will require a new object. Is there a way to statically access or need a new object create...
asked by 27.07.2016 / 13:38
1
answer

Why can not a Trait implement an interface?

Why can not a Trait implement an interface in PHP?     
asked by 10.10.2016 / 15:30