Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Eu posso criar / abrir uma interface no OnlineGDB?

+1 vote
asked May 26 by Paulo Eduardo (130 points)
Eu vinha Pensando sobre. Será que eu posso criar uma interface? Ou ainda, será que eu posso abri-la? Peço por respostas, pois se houver a possibilidade de fazê-lo, então eu posso continuar meu trabalho por aqui, sem precisar baixar uma IDE. Agradeço.

1 Answer

0 votes
answered May 31 by Peter Minarik (54,540 points)

What is an "interface" you're after?

If you mean like a Java or C# interface (opposed to the class), which is about the same as a pure abstract C++ class, then sure you can.

For instance, see the below C# interface example:

using System;

public interface IPerson
{
    string Name { get; }
}

public class Person : IPerson
{
    public string Name { get; }

    public Person(string name) => Name = name;

    public override string ToString() => Name;
}

public class InterfaceExample
{
    public static void Main()
    {
        Person johnDoe = new Person("John Doe");
        Console.WriteLine($"Hello, {johnDoe}!");
    }
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...