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?
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";
& }
&
}
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C#