Static methods

Hi

I have two methods in a static class as follows

static class GetSingleObject
{

  static void GetConnectionToOracle()
  {
 
   //ConnectionString to connect for oracle

  }

  static void GetConnectionToSqlserver()
  {
 
   //ConnectionString to connect for Sqlserver

  }

}


if  i say GetSingleObject.GetConnectionToOracle() , it will returns OracleConnection

and if say GetSingleObject.GetConnectionToSqlserver(), it will returns sqlconnection


I would like to know the following.


1) Is the single object of GetSingleObject Class will return two connection strings

      or it will internally creates two object for GetSingleObject Class.

2) Is every static method in the staic class going to contain its own memory

    or only the memory will be created to Static class ?


Please Clarify
praveen1981Asked:
Who is Participating?
 
praveen1981Author Commented:
Hi

I do agree and understand  you , but i want to know the following.


2) Is every static method in the staic class going to contain its own memory

    or only the memory will be created at Static class level ?
0
 
käµfm³d 👽Commented:
Please explain what you mean by "connection strings".
0
 
CodeCruiserCommented:
Your question indicates that you don't understand what static methods do. Class objects are not created for static methods. The difference between standard (instance) methods and static methods is that an instance of the class is created for instance methods whereas no instance is created for static methods.
0
 
käµfm³d 👽Commented:
Maybe next time respond sooner than 11 days later? Just a thought  = )
0
 
praveen1981Author Commented:
I did not get any response for this , so i am closing this question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.