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
JUKE BOX
NA
28
7.5k
use of constructor in abstract class
Oct 16 2014 3:51 PM
when i wrote below program it gave me exception as
Error
1
'abstractclassconntruct.program' does not implement inherited abstract member 'abstractclassconntruct.A.area()'
F:\net\abstractclassconntruct\abstractclassconntruct\Program.cs
43
15
abstractclassconntruct
can anyone plz help me to sort out it???
using System;
namespace abstractclassconntruct
{
public abstract class A
{
protected double x = 10;
protected double y = 7;
public A()
{
}
public A(double x, double y)
{
this.x = x;
this.y = y;
}
public abstract double area();
}
public class square : A
{
public square()
{ }
public override double area()
{
return x * x;
}
}
public class rectangle:A
{
public rectangle(double x,double y): base (x,y)
{ }
public override double area()
{
return x * y;
}
}
class program : A
{
static void Main(string[] args)
{
square s = new square();
double areacal = s.area();
rectangle r = new rectangle(10, 5);
double areaca = r.area();
Console.ReadKey();
}
}
}
Reply
Answers (
2
)
What will this do?
how to change text fore color in datagrid view