954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to use a class that i created within my project

I have created a gui using extend frame. What my program needs to do is replicate a DNS server, the DNSServer code has to be its own class, So to my project i have added class.

How do i acces the methode within the DNSServer Class?

terrif8888
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

for a static method:
Classname.Method()

for an instance method, then call it like this:
ReferenceToInstanceOfClass.Method()

hope that helps !

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 

so for you it would be (if its a static method):

DNSServer.MethodName()

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 

So in just by includeing, the class in the project, i don't have to do an import or include statement at the beginig of the code that has main?

terrif8888
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

If the classes are in the same project package, I think they should not require an import statement.

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You