Thread: what is asp.net
View Single Post
  #8 (permalink)  
Old May 3rd, 2007, 06:48 AM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

hmm. About your class, are you deriving it from another class? Because, given this code:

using System;
using System.Collections.Generic;

namespace foo
{
    class foo
    {
    
    }
}

The only properties that I can access through something like

{
foo.[property]
}

is Equals and ReferenceEquals (which determines if 2 objects are equal) BUT if i change my class to this

namespace foo
{
    class foo
    {
        public static string fooString()
        {

        }
    }
}

I can do

foo.fooString().ToString(); (This is obviously pointless since fooString returns a string but, at this point, you are accessing all of the properties of the string type since that is what the function returns)

I hope that helps you.

Abstract Classes, as you said, can not be instantiated they MUST be inherited. By inheriting from an abstract class you are not instantating it but doing this:

MyClass foo = new MyClass();

Where MyClass is marked as abstract, this line of code will throw an error since are you explicitly instantiating the object with the intent to work with it directly as opposed to inherting from it.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote