Questions tagged as 'interface'

1
answer

Differentiate class instance from "instance" interface

Is there any way to differentiate% w / o% w / o% w / o in the code below,% w / o% or another method? var v1 = new MinhaClasse(); IMinhaClasse v2 = new MinhaClasse(); I want to execute a method only if the v1 is "instantiated" from...
asked by 25.06.2015 / 04:16
1
answer

What is the difference between Classes and Interfaces?

What is the difference between classes and interfaces ? I've read that apparently the difference in interfaces is because they are 100% public, but I have no idea. Could anyone explain the difference between them?     
asked by 28.02.2016 / 20:57
1
answer

What is the need for an interface to have abstract methods?

We know that in an interface the methods have no implementation, just signing, that is, just defining their methods without the body, we conclude that all are already abstract methods, right? But then why are there statements like: interface E...
asked by 03.01.2018 / 02:13
2
answers

How to check if a class implements an interface, in C #?

How to check if a class implements an interface? For example, I want to include an if that checks whether an object is of type IDisposable. How to do? I tried something like: MinhaClasse meuObjeto = new MinhaClasse(); if...
asked by 25.08.2014 / 15:58
1
answer

Difference class and interface [duplicate]

What is the difference between class and interface and when should I use one or the other?     
asked by 22.06.2016 / 03:35
1
answer

What is the use of default interface methods?

I was seeing some features proposed for C # 8 and I came across the default interface methods .    Add support for virtual extension methods - methods in interfaces with concrete implementations. So I understand it is to allow implementa...
asked by 07.09.2017 / 00:15
1
answer

How to create Interface in JavaScript?

I think a lot of you know about the Interface concept, which is very widespread in OOP, but in JavaScript in all the projects I've worked on until today I have not seen this concept. I researched a little bit about, but most posts are old, s...
asked by 18.11.2018 / 00:22
2
answers

Standard implementations in interface with C #

I was reading about the new features of C # 8 and I came across Default Interface Implentations , that is, standard implementations in interfaces. The code below exemplifies public interface IBankAccountManager{ void PerformTransaction(...
asked by 07.06.2018 / 18:41
1
answer

Transform class with static methods in interface

I have a custom class called ArrayList , which I created to handle objects in a small project of mine, but I would like to abstract it further by transforming it into an interface. This way, I could create other classes that do the same th...
asked by 25.11.2015 / 14:11
3
answers

Is there any interfaces in python?

In languages like PHP and Java, there are interfaces , which, when implemented in a class, forces it to contain the methods of this interface, just as they were declared. Example in PHP: <?php interace UserInterface { public fu...
asked by 03.07.2015 / 17:50