E
E
eliasum2020-05-31 15:16:32
C++ / C#
eliasum, 2020-05-31 15:16:32

Is String a class or an object class?

Hello! There is a string variable:

stringComplex = String.Format(testFormatter, "{0:TEST1}", complex);

, where
public static String Format(IFormatProvider provider, String format, params object[] args);

belongs to the string class.
The question is, is the String in the first line a class or an object class?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Demidko, 2020-05-31
@eliasum

Static methods are those that can be called by the class name. Class.AnyStaticMethod(). They can only use static fields. Of course, terminologically this is not true, but you caught the meaning correctly, in this case the class itself acts as an object.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question