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.7k
Inconsistent accessibility
Aug 18 2013 11:08 AM
In the following program, if both are "
public
" error signal is saying that Inconsistent accessibility.
Program is to executive correctly, if both accessibilities left unmentioned or one of the accessibility was mentioned "
public
". Problem is highlighted
Please explain the reason for differences.
using System;
public
class Program
{
public static void Main()
{
IceCreamCone vanilla2 = new IceCreamCone("Vanilla", 2);
IceCreamCone chocolate1 = new IceCreamCone("Chocolate", 1);
FlavorScoop(vanilla2);
FlavorScoop(chocolate1);
Console.ReadKey();
}
public
static void FlavorScoop(IceCreamCone icc)
{
Console.WriteLine(icc.GetFlavor() + " flavor" + ", " + icc.GetScoops() + " scoop");
}
}
class IceCreamCone
{
string flavor;
int scoop;
public IceCreamCone(string flavor, int scoop)
{
this.flavor = flavor;
this.scoop = scoop;
}
public string GetFlavor()
{
return flavor;
}
public int GetScoops()
{
return scoop;
}
}
Reply
Answers (
18
)
mono for android arsgen file not found
How to use params instead of method overloading...