-7
public static SshShell SshServer;

I know that SshShell is class, but I couldn't get what SshServer is? Could you please explain above whole line?

3
  • 5
    It's the name of the static field.
    – dcastro
    Commented Sep 14, 2015 at 10:48
  • 8
    I think it'll be a good idea to start reading a book
    – Izzy
    Commented Sep 14, 2015 at 10:50
  • 3
    12 downvotes ... really? ... it's a reasonable beginner question - the C# community here is getting more toxic by the hour
    – Random Dev
    Commented Sep 14, 2015 at 12:07

4 Answers 4

3

It's the name of the static field of type SshShell .

2

The line signifies a variable declaration. A declaration in C# has the following syntax:

<modifiers> <data_type> <variable_name>;

The first two words in the line you provided are modifiers, they are used for modifying declarations.

  • public is an access modifier
  • static specifies that a member belongs to the type itself instead of to a specific object.

Moving on, SshShell is the type of the variable and SshServer is the name of the variable.

You can find more info on the C# reference.

1
  • That's not a variable, it's a field. Commented Sep 14, 2015 at 12:55
2

SshServer is the name of your SshShell field.

2

It's a field name.

 public static SshShell SshServer;

 public void Test()
 {
     SshServer = null;
 }

Not the answer you're looking for? Browse other questions tagged or ask your own question.