How do you create static methods using C#? How do you specify each items in the static methods? thanx.. I'm a C# newbie >.<

Recommended Answers

All 3 Replies

How do you create static methods using C#?

class staticClass {
  public static void staticMethod() {
    //do something
  }
}

How do you specify each items in the static methods? thanx.. I'm a C# newbie >.<

I don't understand this question? what is an item?

search for a tutorial about c#, which gives more details about static stuff and more...

I think he means parameter not items. Parameters are pased to static methds in the same way that parametes are passed to private , public, etc methods. No special parameter syntax required.

I think he means parameter not items. Parameters are pased to static methds in the same way that parametes are passed to private , public, etc methods. No special parameter syntax required.

yeah, actually I found the way to do it.. haha that's cuz I'm new with C# right, that's why I kind of confused with the namespace :eek:

  1. <LI class=li1>

class staticClass {
<LI class=li1> public static void staticMethod() {
<LI class=li1> //do something
<LI class=li1> }
[*]}
instead of that, i put public class static void ... bla bla, didn't realize that it's inside a class already >.< thanx guys! :twisted:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.