Most voted "interface" questions
Used for object orientation concept. DO NOT USE for user interface or hardware component.
Learn more…200 questions
Sort by count of
-
1
votes1
answer38
viewsdoubts generic class Asp.net mvc
Good night, In my project I have an application layer where the class is structured as follows: namespace ProjetoTreino.Aplicacao { public class PessoaAplicacao { private readonly…
-
1
votes1
answer51
viewsWhere and when to decide which concrete class (which implements a given interface) should be instantiated?
Okay, this is the classic problem to be solved with the use of interfaces, right? Let’s take the example: I have a DLL that will be used by different companies, each with their bank and their Pessoa…
-
1
votes1
answer217
viewsHelp with kivy (error: Attributeerror: 'weakref' Object has no attribute 'cline_in_traceback')
I’m learning the kivy (so I’m pretty virgin in the Gui subject) and I came across this mistake: important part: Attributeerror: 'weakref' Object has no attribute 'cline_in_traceback' full run: [INFO…
-
1
votes2
answers281
viewsClass that implements two interfaces that have identical signature methods
I have a class that implements two interfaces. Each of these interfaces has an identical method, for example: public interface InterfaceA{ void doSomething(String params); } public interface…
-
1
votes2
answers77
viewsIf an A class is an implementation of an X interface, will the subclasses of A also be?
With the interface Posicionavel: package projeto; public interface Posicionavel { public boolean mesmaPosicao(Posicionavel p); public boolean mesmaPosicao(int[] x); public int[] posicoes(); } And…
-
1
votes0
answers141
viewsInterface and heritage in Xamarin - System.Invalidcastexception: Specified cast is not Valid
Greetings! I’m developing a Cross Platform project in Xamarin. This project consists of consuming a web-service method that will return the script code and an address array that corresponds to the…
-
1
votes1
answer97
viewsWhat is Ienumerable.Getenumerator in C#?
I was reading this documentation and I came across the following piece of code within a class that implements IEnumerable: // Implementation for the GetEnumerator method. IEnumerator…
-
0
votes1
answer96
viewsHow to run methods of all classes extending an interface on symfony
I needed something similar to that console doctrine:fixtures:load in relation to class DataFixtureLoader and the interface OrderedFixtureInterface that is, I want to make a Command where it searches…
-
0
votes1
answer369
viewsInterface vs Class - method visibility
I did a job for school and it’s working perfectly. In the code I have some private methods. I need to create an Interface of this class to hide these private methods or they can be in the same class…
-
0
votes1
answer300
viewsWhat is the endpoint interface in EJB?
I am studying EJB(Enterprise Java Beans) and would like to know, within the context of distributed applications, what is the role of the endpoint interface. What is the endpoint interface? Where and…
-
0
votes2
answers201
viewsInterface with the same class name
namespace path; interface test{ public function method(); } class test{ } class foo implements test{ } When writing the above code a fatal error is returned: Cannot declare class path\test, because…
-
0
votes0
answers60
viewsJava interface
I’m beginner in Java and I’m having some questions about interfaces, I wonder if someone can explain to me the theoretical part of interfaces, if someone has a simple example Interface, I thank you.…
-
0
votes3
answers2201
viewsHow one class can inherit from one interface and another class in Delphi
I’m creating a small persistence class using RTTI. I created the attributes of fields separated by type Ex: Fieldstring[], Fieldinteger[] and etc.. At a certain point I need to go through the…
-
0
votes1
answer74
viewsWhere is my mistake?
I’m playing a little game on Android very simple, but I’m having problems with the interface. I created the xml interface, and I set the java class corresponding to it (setContentView...), until…
-
0
votes1
answer300
viewsWhat is the Traversable interface for in PHP?
In the PHP Handbook we can see that some classes can be iterated with foreach implement an interface called Traversable. For example, the class DatePeriod There, when I have implement an object of…
-
0
votes0
answers97
viewsValue-based dynamic interface of an object (Typescript)
I’m trying to accomplish the following: interface A { name: string, type: string } let var_A: Array<A> = [ {name: 'firstName', type: 'string'}, {name: 'lastName', type: 'string'}, {name:…
-
0
votes1
answer382
viewsTake a class that has a certain interface implemented in Generics
Hello. I want to do something like metodo(Class<? extends ClasseAbstrata> classe), only that of an abstract class, I want to use a interface, but I’ve moved on from extends for implements the…
-
0
votes1
answer129
viewsHow to make a graphical interface of a menu?
Guys I want to make a menu with graphical interface, I’ve done in C the code without graphical interface, but as in C is not possible to make interfaces, you know options besides Tkinter, qtcreator,…
-
0
votes1
answer196
viewsError declaring an interface to the class in PHP?
I’m having trouble declaring a interface to a classe in the PHP where I’m encapsulating the entire program with namespace. I created a interface calling for Yargle in the directory Cnab\Remessa and…
-
0
votes1
answer654
viewsc++ - How to pass parameters between Windows in Qt?
Hi, I’m trying to pass a mat parameter from one window to another, being activated by the click of a button. The program compiles and runs normally, but when clicking the button that activates the…
-
0
votes0
answers210
viewsNot all additional attributes appear in android studio
Great community, I’m starting now in Android Studio and face already I came across a "problem" that I could not solve, I need the help of gentlemen. I need to link a function to a button, however,…
-
0
votes1
answer63
viewsHow can I make my code with fewer lines?
I currently have a large number of lines in my code: Below is the insertion part of players, these players will have the names searched from the bank and sent by cmb box. private void Verificar() {…
-
0
votes1
answer293
viewsHow to create the Docker file from a Maven java SE program?
I actually wrote a Java SE Maven application using netbeans and made a CRUD for some entities that are scanned in the database through JPA. I was wondering if it is possible to run a textual…
-
0
votes0
answers32
viewsTypescript interface: Only one record per index
How to create an interface capable of only logging 1:1 in the IAgendaConfig through the attribute IAgendaDia.diaSemana (Prevent if there is no day of the week or if there is a duplicate on…
-
0
votes0
answers18
viewsWhy, in Java, should one prioritize the use of interfaces, rather than inheritance with classes?
I wonder why, in Java, one should prioritize the use of interfaces, rather than inheritance with classes.
-
0
votes1
answer58
viewsWhat is the criterion of Java in having in some cases, a class in its API and in other cases an interface?
The Java API is immense, but some pre-defined features in it are implemented through a class and other functionality through an interface. What criterion used by Java to choose one or the other?…
-
0
votes0
answers18
viewsDifference of Typescript Interface declaration
What is the difference between the declaration of the properties of the two interfaces? interface Modelo { propriedade: InterfaceA[]; <= desta forma } and in this way: interface Modelo {…
-
0
votes1
answer612
viewsPyqt calling file created by Qtdesigner
I developed a Pyqt window with Dialog with Buttons Right template but calling me in my main class gives me an attribute error. I saw in the YT video that the guy used Main Window as a template and…
-
0
votes1
answer179
viewsHandling of JAVA Attributes
Good afternoon, I’m with a college job and it’s the first semester I’m learning java. The job basically is: Make an interface that would represent any geometric figure, in it specify methods of area…
-
0
votes1
answer408
viewsDTO - Interface x Class
I have used Interface to create DTO (Data Transfer Objects), "dumb" objects that only serve to standardize the communication of objects between the front and back. My question is this: Is actually…
-
0
votes1
answer710
viewsDoubt Exercicio Collections - Queue Interface
I’m having a question in this exercise about Collections in which I should use the Queue interface : Write a program that simulates control of an airfield at an airport. In this program, the user…
-
0
votes1
answer303
viewsInstantiate a class that inherits an interface class
I have a class that inherits many interface classes, and I want to instantiate it to use only one method, how do I do? It is possible to do without passing all the necessary parameters? public class…
-
0
votes1
answer236
viewsHow to solve this diamond inheritance problem
Can anyone solve this problem (diamond heritage) with the use of Interfaces and post here in c#? I found it in this post: Why C# does not allow multiple inheritances? but I couldn’t solve it.…
-
0
votes1
answer52
viewsHow to assign a Json font within an interface
I am trying to generate an interface of a Json file but this error, what would be the error in my code? export interface Compra { event: string; timestamp: number; custom_data: number; value:…
-
0
votes1
answer1608
viewsInterface dependency injection in Typescript - Angular 6
I am doing the front end of a project using Angular 6, but I am beginner in both Angular and Typescript and I am trying to use the interfaces of Typescript as in Java, injecting them to use the…
-
0
votes0
answers87
viewsReturn Iobservable in a method
I have a method that needs to return an Iobservable, but I’m having a lot of trouble. There is little content regarding this interface and what I find requires the use of the Reactive extension…
-
0
votes1
answer64
viewsHow to delegate UI methods automatically
I created these methods in the interface: public interface IEvents { void OnEscrever(string text); void OnEnable(bool b); void OnDisable(bool b); } I’ll have some classes that will inherit these…
-
0
votes1
answer71
viewsInject multiple Idbconnection into Asp.Net core
Good morning, you guys, all right? I need to inject 2 Dbcontext into Asp.net core and I’m having problems with it. Follow the code example. string defaultConnectionA =…
-
0
votes1
answer77
viewsC# - How to create an implementation contract with subclasses to be implemented?
I would like to create an interface (called Interfacex) interface InterfaceX { ... } Where your future implementation returns the following structure:…
-
0
votes1
answer276
viewsHow to use print in the graphical interface?
I need the result of the function print((randint(0,700)) appear on the label (label) of my program window (created with Py’s own Qt Designer), and not in the interpreter, but only know the command…
-
0
votes0
answers16
viewsJava - Interface
I was studying interface and I came up with a question in the code below: public class TesteGerente { public static void main(String[] args) { Autenticavel referencia = new Cliente(); Gerente g1 =…
-
0
votes0
answers62
viewsHow to transfer data from a graphical interface to another Java file and receive it later after data processing
Creating a Java project, which has only two files: the first has a InterfaceGrafica, that takes the data that users will enter, being responsible for sending the data to the second file called…
-
0
votes2
answers210
viewsHow to convert a value to float and int in python?
Hello, I am trying to convert a received value from a graphical interface to int or float, to make a software that solves the second degree equations. layout = [ [sg.Text('Termo A:'),…
-
0
votes0
answers19
viewsIt is possible to capture the click result in a Dialogfragment
I’m new in android development and have this doubt. I’m creating a DialogFragment with an interface to capture user choice. This is my dialog box next to the interface: public class Opcoes extends…
-
0
votes1
answer57
viewsUnreported variable type error in class constructor
I’m creating a class of ErrorHandler for an API. When creating variables in the class constructor, Typescript accuses that variable statusCode does not have a defined type: interface ErrorObj {…
-
0
votes1
answer44
viewsAllow maximize and minimize windows in Pysimplegui
I’m trying to make a text/note program, like Word or notepad in Pysimplegui. Before I started doing it, I needed test programs, and in one of them I have a problem: allow to maximize and return to…
-
-1
votes1
answer153
viewsDoubt Interface Asp.net mvc
Good night, I have a doubt, I chose to work with Generica interface and my doubt is: Every entity needs to have an interface inheriting from the Generica interface ? Ex: public interface…
-
-1
votes2
answers56
viewsAndroid change the color of a button for 1second
I have an array that contains integer numbers from 0 to 4. {1,4,0,3,2} need a button to blink a certain color according to the sequence. How this is done ?
-
-4
votes1
answer34
viewsHow to get the Membernames property with the index?
I started programming in C# a little while ago and I’m doing a validation treatment using Data Annotation with windows Forms, I have a problem that I can’t get the Membernames property from the…
-
-4
votes1
answer72
viewsHow to pass the array from a method to Another method using interface
I want to create a program that uses interfaces to create a vector class with name and size and have the methods below: <> +Definirnometamanhovetor +PreencherVetorCriadoInformandoPosicaoValor…