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.8k
Interface
Aug 23 2012 6:03 PM
This program is given in the following website (http://www.developer.com/net/csharp/article.php/1482651/Working-with-Interfaces-in-C.htm) Listing 3.
In the program if(inter is Interdemo1) is
false
.
Is there any possible modification to make if(inter is Interdemo1) is
true
. Code is highlighted
using System;
interface Interdemo
{
bool Show();
}
interface Interdemo1
{
bool Display();
}
class Interimp : Interdemo
{
public bool Show()
{
Console.WriteLine("Show() method Implemented");
return true;
}
public static void Main(string[] args)
{
Interimp inter = new Interimp();
inter.Show();
if (inter is Interdemo1)
{
Interdemo1 id = (Interdemo1)inter;
bool ok = id.Display();
Console.WriteLine("Method Implemented");
}
else
{
Console.WriteLine("Method not implemented");
}
Console.ReadKey();
}
}
Reply
Answers (
2
)
Data types in vb.net
c# datatables Comnination...