firs i created different topic because this topic is totally differet where you posted your answer, and may other people can add something extra :
hi guys i m back afrer sometime(by the way i m CompTia
hey brner i red all of your explanations about the languages actually i m learning C# in .net enviroment but i have a problem about polymorfism,inheritance,abstract class or methods and also i cant make my asp.net work.could you give some help here...(i m running windows xp pro on my computer)
thanks to everybody from now who ll atend to help!!!
here it is:
Hi Black Sea !!!
First of all I would like to say that oop (object oriented) is big concept as I said before, and inheritance and polymorphism are feature of oop. there are many and many tutor out there about that ….
You asked about Inheritance and Polymorphism?
And secondly you are asking about setting up ASP.net and its not unusual question and I am not surprised because it is hard work to set it up(even for advance) it needs some work to done…
I will try to give your answers with definition and examples,
Think cat class (by the way I am veterinarian,…believe me)
Golden class and so on.
The primary characteristic of the animals on the above is that they are cats in the same class but different category. Another point they share is that is they are animals. On the other hand, although these cats have different characters like tail length, legs length, teeth structure, body size. The class would appear as:
If you want to create class to represent these cats, you may be tempted to implement a general class that defines each category. This may be a bad idea because, despite their body resemblance, there are many internal differences among these cats. Programming languages (oopl) like C#, java, C++, and other(oopl) provide an alternate solution to this type of situation.
Inheritance consist of creating a class who we primary definition or behavior is based on another class. In other words, inheritance starts by having a class that can provide behavior that other classes can improve on.
C#, like java and contrary to C++, allows only single class inheritance. Multiple inheritances of classes are not allowed in C#.
If you were using a language such as C++ you could easily inherit from both classes using multiple inheritances.
Structures (struck) in C# can only inherit (or implement) interfaces and cant be inherit.
And if you don’t want your class to be inherited by any class, you can mark it with the sealed keyword. No class can inherit from a sealed class.
public static void Main()
child a=new child();
class parent //based class
public int i = 10;
public void abc()
System.Console.WriteLine("in parent abc");
public void pqr()
System.Console.WriteLine("in parent pqr");
class child :parent //driven class(in child)
public void abc()
System.Console.WriteLine("in child abc");
base.pqr(); //calls the base class` method which is pqr in parent
In child abc, In parent pqr
Base.pqr(), calls the pqr() in parent class. If you don’t use it in there it does not call pqr() in parent class and the output will be only in child abc.
If you don’t have the method abc in child class than it will use the method abc which is in parent class.
As a short you re a calling in main function a.abc(), if it is not find abc() in child class it will look in base class and when it finds than executes that method.
I tried demonstrated all possibilities.
It is little bit tricky:
MSDN explanation: “Polymorphism is the ability for classes to provide different implementations of methods that are called by the same name. Polymorphism allows a method of a class to be called without regard to what specific implementation it provides.”
public static void Main()
parent a=new parent();
child b =new child();
parent c=new child();
class parent //based class
public virtual void abc() //virtual method
System.Console.WriteLine(“in parent abc”);
public virtual void pqr() //virtual method
System.Console.WriteLine(“in parent pqr”);
public virtual void xyz() //virtual method
System.Console.WriteLine(“in parent xyz”);
class child : parent //driven class(child)
public override void abc()
System.Console.WriteLine(“in child abc”);
public new void pqr()
System.Console.WriteLine(“in child pqr”);
public void xyz()
System.Console.WriteLine(“in child xyz”);
In parent abc, in parent pqr , in parent xyz, in child abc, in child pqr, in child xyz, in child abc, in parent pqr, in parent xyz
Little explanation see the keywords “virtual, override, new” ….
Object c was initialized by a child object and hence it first goes to class child. Here the function has a modifier override which in Engilish means, forget about the data type of c which is parent , call abc from child as it overrides the abc of the base class. The override modifier is needed as the derived class functions will get first priority and be called. I mean to override the abc of the base class.
New has the exactly the opposite meanings. The function pqr has the new modifier.c.pqr() calls qpr from parent and not child. New means that the function qpr is a new function and it has absolutely nothing to do with the pqr in the base class.
Abstract classes can be simply defined as incomplete classes.
1-Abstract classes contain one or more incomplete methods called abstract methods.
2-The abstract class only provides the signature or declaration of the abstract methods and leaves the implementation of these methods to derived or sub-classes.
I would give an example about it later for now I guess is enough for you take rest…… but you can find good explanation in here :
about setting up ASP:
I don’t know what kind of problem you have but this is common problem everybody has it and I had it 2years ago when I try to set up vs.net first my machined, before asp I was using perl CGI and I can say that asp is much more better than CGI programming.
If there is a better technology why don’t I use it…
So now lets see what can we do for setting up asp hhhh
of course if you dont have IIS installed you MUST install it first. Installing IIS
->controlpanel->add/remove prog->add windows components (left side)-
>check ISS box and click next with inserting xp pro cd to your cd
room drive and next for installing.
After installing first thing you have to check that if your asp net is working or not
so (mostly not)if it is working there is no problem and go ahead and its ready to serve you....lucky cat:)
second its not working
1-when you open your IE browser and type "//localhost" in address
section and see what happended if you get error ;
says http 500 --->that error code means you dont get real error code
for getting real error code follow this steps:
on IE->tools->internetOPtions->advance-> and if it is check "show
friendly error messages" check box under Browsing. and ok
try to type localhost again and enter and see the error code!!!
2-if it gives you the error[code=cannot_......] so you have to make
sure that you re using proxy server or blah blah...
on IE tools->internet options->connections->lan settings->uncheck the
check box option of "automaticly detect settings"..(Idiot IE)
and type "//localhost" IE browser address bar... working?
You still have problem? if yes and says version of .net the error says "version 1.1....blah blah " so its need to be updated run the windows updater and update it then restart your machine. still getting same error don’t worry after install the updates you have to transfer your updates to .net and install it again how : lets see now how ...
start->programs->Microsoft visual studio .net->visual studio .net
tools->visual studio .net command prompt black and ugly screen pop up
and type in : "aspnet_regiis /i" and it started to install it and
after it says installed than close your ugly black screen and go to
open your visual studio and new project asp.net web application under (vb or c# or...) and
mine is working and yours should be:)
"when i was 15, i had a dog its name was bingooooo!!!!!!!!
take care now
if there is any comment let me now haaa my number is still