Câu hỏi phỏng vấn C#
Câu hỏi

What is an Object ?

Câu trả lời

What is an Object?

In C#, an object is an instance of a class. A class is a blueprint or template that defines the properties (data) and methods (functions) that an object will have. When you create an object from a class, you are creating an instance of that class with its own unique set of properties and methods.

Here are some key points about objects in C#:

Properties

  • Properties are variables that store data associated with an object.
  • They define the characteristics or attributes of an object.
  • Properties can be public, private, or protected, depending on their accessibility.

Methods

  • Methods are functions that define the behavior or actions that an object can perform.
  • They encapsulate the logic and operations that an object can execute.
  • Methods can take parameters and return values, just like regular functions.

Instantiation

  • To create an object, you use the new keyword followed by the class name.
  • Each object created from a class is a separate instance with its own memory...
entry

entry

Gợi ý câu hỏi phỏng vấn

junior

What are partial classes?

middle

What is Record in C#?

senior

What is the difference between Func<string,string> and delegate ?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào