TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
324.9k
Access modifier
Jul 12 2013 8:28 PM
In the this program if you write
public
in front of
static void
Display(Employee num) program is not executing. Please tell me the reason. Problem is highlighted.
But
internal
access modifier instead of
public
in the program is executing.
using System;
public class CreateEmployee
{
public static void Main()
{
Employee myAssistant = new Employee();
myAssistant.SetId(345);
Display(myAssistant);
Console.ReadKey();
}
static void Display(Employee num)
{
Console.WriteLine("ID # is {0}", num.GetId());
}
}
internal class Employee
{
private int idNumber;
public int GetId()
{
return idNumber;
}
public void SetId(int id)
{
idNumber = id;
}
}
// ID # is 345
Reply
Answers (
7
)
site authentication with twitter and facebook
Auto Increment Of Alphanumeric number using c#