Answer to Question #4181 in C# for lalitkumar

Question #4181
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";
& }
&

}
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS