Create a class library and define class 'User'. In [i]user[/i] class define the public, protected and friend functions. Create a console application and add a reference to this library and call the user methods by creating the object. Which are the functions allowed to call here?
1
Expert's answer
2012-03-27T10:20:57-0400
using System; using System.Collections.Generic; using System.Linq; using System.Text; using UserLibrary;
namespace Question4181 { class Program { & static void Main(string[] args) & { User newUser = new User(); Console.WriteLine(newUser.getName()); & } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace UserLibrary { public class User { & public User() { } & public string getName(){ return "Name"; & } & protected string Surname(){ return "Surname"; & } &
Comments
Leave a comment