Share via


public Modifier

Declares that a class, interface, or member has public visibility.

public statement

Arguments

  • statement
    Required. A class, interface, or member definition.

Remarks

The public modifier makes a member of a class visible to any code that has access to the class.

All classes and interfaces are public by default. A member of a class or interface can be marked with the public modifier.

You may not combine the public modifier with any of the other visibility modifiers (private, protected, or internal).

Requirements

Version .NET

See Also

Reference

private Modifier

protected Modifier

internal Modifier

var Statement

function Statement

class Statement

Concepts

Scope of Variables and Constants

Other Resources

Modifiers