|
-
June 6th, 2009, 06:24 AM
#1
Namespace
Hello all,
its my first day on C#.
I'm trying to use namespaces but its not working.
I'm trying to call a method in namespace namespaceTest.test1 with
Code:
testing test = new testing1();
. I get this message: The type or namespace could not be found.
Any idea how to edit that line so that i can use the method in namespace namespaceTest.test1
Code:
// The C# Station Namespace
namespace namespaceTest
{
namespace namespaceTest.test1
{
// Program start class
class testing1
{
// Main begins program execution.
public int test()
{
Console.WriteLine("This is the new C# Station Namespace 2.");
return 10;
}
}
}
namespace namespaceTest.test2
{
using namespaceTest.test1;
// Program start class
class testing2
{
// Main begins program execution.
public void test()
{
testing test = new testing1();
Console.WriteLine("This is the new C# Station Namespace 2.");
}
}
}
}
-
June 6th, 2009, 06:33 AM
#2
Re: Namespace
Code:
testing test = new testing1();
should be
Code:
testing1 test = new testing1();
I bet the C# compiler doesn't know what 'testing' is - you haven't defined a 'testing' only a 'testing1' class.
Darwen.
-
June 6th, 2009, 08:30 AM
#3
Re: Namespace
ohh thats so noobies of me. Thank you...like i said this is my first C# day hehe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|