Skip to content

Instantly share code, notes, and snippets.

@netojoaobatista
Last active December 10, 2015 20:48
Show Gist options
  • Save netojoaobatista/4490256 to your computer and use it in GitHub Desktop.
Save netojoaobatista/4490256 to your computer and use it in GitHub Desktop.
using System;
namespace visibility
{
public class Sample
{
public static void Main (string[] args)
{
User user = new User("Neto");
User.changePrivateName(user, "João Batista Neto");
user.showPrivateName(); //João Batista Neto
}
}
}
using System;
namespace visibility
{
public class User
{
private String privateName;
public User(String name)
{
privateName = name;
}
public static void changePrivateName(User user, String name)
{
user.privateName = name;
}
public void showPrivateName()
{
Console.WriteLine(privateName);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment