Hi there,
Is that any known issue if I had created many class that have many static
methods?
Regards,
Gun 4 1767
Gunawan wrote:
Hi there,
Is that any known issue if I had created many class that have many
static methods?
What makes you wonder?
AFIAK, the answer is no.
-cd
I know there is a relation with the static method and the static
constructor, if I remeber it correctly, when you execute a static method of
a particular class for the first time it will execute the static constructor
too, where if you have loaded with many operation in the constructor it tend
to be little slow.. is this correct???
Nirosh.
"Carl Daniel [VC++ MVP]" <cp************ *************** **@mvps.org.nos pam>
wrote in message news:uV******** ******@TK2MSFTN GP03.phx.gbl...
Gunawan wrote:
>Hi there, Is that any known issue if I had created many class that have many static methods?
What makes you wonder?
AFIAK, the answer is no.
-cd
On Apr 4, 8:58 am, "L.W.C. Nirosh" <t...@test.comw rote:
I know there is a relation with the static method and the static
constructor, if I remeber it correctly, when you execute a static method of
a particular class for the first time it will execute the static constructor
too, where if you have loaded with many operation in the constructor it tend
to be little slow.. is this correct???
That's not particularly related to static methods. When you do almost
anything with a class which has a static constructor in, it will call
the static constructor the first time. Usually that will be calling a
static method or creating an instance.
Jon
oh! yes..
"Jon Skeet [C# MVP]" <sk***@pobox.co mwrote in message
news:11******** **************@ l77g2000hsb.goo glegroups.com.. .
On Apr 4, 8:58 am, "L.W.C. Nirosh" <t...@test.comw rote:
>I know there is a relation with the static method and the static constructor, if I remeber it correctly, when you execute a static method of a particular class for the first time it will execute the static constructor too, where if you have loaded with many operation in the constructor it tend to be little slow.. is this correct???
That's not particularly related to static methods. When you do almost
anything with a class which has a static constructor in, it will call
the static constructor the first time. Usually that will be calling a
static method or creating an instance.
Jon This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Murat Tasan |
last post by:
so here is another general question about java...
why can't you declare an abstract static method.
i can envision the case (indeed i have experienced the case) where one
would want an abstracct superclass, with an abstract method such that all
subclasses that implement this method make that method static.
basically, the abstract class declares an abstract method that should be
static for all implementations (for example a factory...
|
by: Chris |
last post by:
Hi
I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have the same class/static method definition statictly linked to my EXE and when I call InvokeMember(...), even though I got the Type from the new AppDomain, it calls the static method that I am staticly linked to and not the static method in the dynamicly...
|
by: baylor |
last post by:
In C#, an interface cannot mark any method as static. i'm told the ILASM
supports it but i've never tested that
Two questions. First, why? OK, i've heard the reason about interfaces being
allocated on the stack but that's not a real reason. Which is OK because this
isn't a real question, it's just a complaint dressed up to look like a reason
Second question. If a language doesn't support a fairly obvious feature, one
has to wonder if...
|
by: Jay |
last post by:
Why are there static methods in C#. In C++ static was applied to data only
(I believe) and it meant that the static piece of data was not a part of the
object but only a part of the class (one copy of data as opposed to multiple
instances of the class)
C# is now applying the static concept to methods. Why?, I thought that only
one copy of the methods were loaded into memory not matter how many
instances were created. Is this different...
|
by: Fernando Lopes |
last post by:
Hi there!
Someone has some code sample about when is recommend use a statis method?
I know this methos don't want to be initialized and all but I want to know
when I need to use it.
Tks.
Fernando
| |
by: Dave |
last post by:
I used the following class and .aspx code below to understand how static
works on variables and methods taken from
"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfstaticpg.asp".
I opened up two instances of my browser to simulate two users accessing the
page at the same time by pointing to Employee.aspx below. Refreshing several
times, the counter value is increased and shared between both browser...
|
by: superseed |
last post by:
Hi,
I'm pretty new to C#, and I'm quite stuck on the following problem.
I would like to add to my application a Windows.Form (singleton) on
which I could display a message of one of the following type :
Exception, Error, Warning, Infos (with differents colors, etc).
I would like to use it like the Console.WriteLine("My Message"); on
everywhere in my application.
|
by: Kevin Prichard |
last post by:
Hi all,
I've recently been following the object-oriented techiques discussed
here and have been testing them for use in a web application. There is
problem that I'd like to discuss with you experts.
I would like to produce Javascript classes that can be "subclassed"
with certain behaviors defined at subclass time. There are plenty of
ways to do this through prototyping and other techniques, but these
behaviors need to be static and...
|
by: Steve Richter |
last post by:
in a generic class, can I code the class so that I can call a static
method of the generic class T?
In the ConvertFrom method of the generic TypeConvert class I want to
write, I have a call to the static Parse method of the conversion
class.
if (InValue is string)
return T.Parse((string)InValue);
else
return base.ConvertFrom(context, culture, InValue);
|
by: Steffen Bobek |
last post by:
Extension methods are made for use with instances. I'd like to "misuse" them
as static methods, too. Let me tell you my ambition:
I use an extension method to serialize objects somehow like this:
MyObject obj = new MyObject();
obj.ToXmlFile("some directory\\some file.xml");
The method "ToXmlFile" is defined elsewhere far apart from MyObject to work
for all objects:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |